This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function( $ ) { | |
$( document ).on( 'click', '.plus, .minus', function() { | |
// Get values | |
var $qty = $( this ).closest( '.quantity' ).find( '.qty' ), | |
currentVal = parseFloat( $qty.val() ), | |
max = parseFloat( $qty.attr( 'max' ) ), | |
min = parseFloat( $qty.attr( 'min' ) ), | |
step = $qty.attr( 'step' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'mobile_cart', 'artabr_header_card' );// хук должен быть где-то в шапке или просто функцию выводите в нужном месте | |
function artabr_header_card() { | |
global $woocommerce; | |
$count = $woocommerce->cart->get_cart_contents_count(); | |
//$count = get_cart_contents_count(); | |
?> | |
<a class="cart-link" href="<?php echo wc_get_cart_url(); ?>" title="Смотреть корзину"> | |
<!--<span class="dashicons dashicons-cart"></span>--> | |
<?php if ( $count > 0 ) : ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'after_setup_theme', 'art_remove_wc_lightbox_zoom', 100 ); | |
function art_remove_wc_lightbox_zoom() { | |
remove_theme_support( 'wc-product-gallery-lightbox' ); | |
remove_theme_support( 'wc-product-gallery-zoom' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.product-content--meta--list { | |
margin: 0; | |
padding: 0; | |
} | |
.product-content--meta--list tbody { | |
display: grid; | |
gap: 12px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Вывод избранных атрибутов в карточке товара | |
* | |
* @param $product | |
* | |
* @return array | |
*/ | |
public function get_attributes_to_product( $product ) { | |
$product_attributes = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true; do | |
POSTS=$(wp db query 'SELECT ID FROM wp_posts WHERE post_type="attachment" AND post_date < "2022-06-05" LIMIT 10000;' --skip-column-names | paste -s -d ' ' -) | |
if ! [ -z "$POSTS" ]; then | |
wp post delete $POSTS --force | |
else | |
exit 0 | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function has_product(): array { | |
$has_product_page = is_shop() || is_product_category() || is_product_tag() || is_product(); | |
global $post; | |
if ( ! $post ) { | |
return [ false, false, false ]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_form_field', 'art_change_woocommerce_form_field', 10, 4 ); | |
/** | |
* Изменение хтмл полей | |
* | |
* @param $field | |
* @param $key | |
* @param $args | |
* @param $value | |
* | |
* @testedwith WooCommerce 7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function art_adding_attributes( $post_id, $xml_node ) { | |
// Ограничиваем работу сниппета нужным импортом | |
$import_id = ( $_GET['id'] ?? ( isset( $_GET['import_id'] ) ? $_GET['import_id'] : 'new' ) ); | |
$attributes_from_string = []; | |
if ( ( '31' === $import_id || '26' === $import_id ) && $xml_node->dimensions ) { | |
$sep = '/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Blow_Roles { | |
public function __construct() { | |
$this->hooks(); | |
} |