This file contains hidden or 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
/** | |
* Автоматическое применение купона, если в корзине есть товары из определенной категории | |
* | |
* @testedwith WooCommerce 6.0 | |
* @author Artem Abramovich | |
*/ | |
function art_apply_matched_is_category() { | |
// Код купона | |
$coupon_code = 'vamkover'; |
This file contains hidden or 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 | |
/** | |
* Добавление кнопки Очистить корзину зарзу после кнопки Добавить купон | |
*/ | |
function art_add_empty_cart_button() { | |
printf( | |
'<a href="%s" class="button" title="Очистить корзину">Очистить корзину</a>', | |
esc_url( add_query_arg( 'empty_cart', 'yes' ) ) |
This file contains hidden or 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
/** | |
* Вывод сообщения о бесплатной доставке | |
* | |
* @testedwith WooCommerce 5.5 | |
* @author Artem Abramovich | |
*/ | |
function free_shipping_cart_notice() { | |
// Сумма от которой считается бесплатная доставка | |
$min_amount = 100000; |
This file contains hidden or 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
/** | |
* Расчет объема заказа в кубических метрах | |
* | |
* @return float|int | |
* | |
* @author Unknown | |
* @verphp 7.4 | |
*/ | |
public static function get_cart_volume() { |
This file contains hidden or 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
/** | |
* Plugin Name: Фильтр необходимых плагинов для импорта из 1С | |
* Description: Отключает все плагины, кроме необходимых для импорта товаров из 1С | |
*/ | |
$is_import = false !== strpos( $_SERVER['REQUEST_URI'], 'pmxi-admin-manage' ); | |
$is_trash = false !== strpos( $_SERVER['REQUEST_URI'], 'action=delete' ); | |
$is_trash_delete_all = false !== strpos( $_SERVER['REQUEST_URI'], 'delete_all' ); |
This file contains hidden or 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
/** | |
* Отключение заголовка товара на архивах | |
* | |
* @author Artem Abramovich | |
* @testedwith WC 5.8 | |
*/ | |
add_action( 'after_setup_theme', function () { | |
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); | |
} ); |
This file contains hidden or 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
$( '.feedback a' ).magnificPopup( { | |
type: 'ajax', | |
callbacks: { | |
elementParse: function( item ) { | |
postData = { | |
action: 'feedback_ajax_action', | |
form_id: $( item.el[0] ).attr( 'data-form-id' ) | |
}; | |
var mp = $.magnificPopup.instance; |
This file contains hidden or 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 int $post_id ID созданного товара | |
* @param object $xml_node Объект узла | |
* | |
* @author Artem Abramovich | |
* @verphp 7.4 | |
*/ | |
function art_adding_attributes( $post_id, $xml_node ) { |
This file contains hidden or 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( | |
'sanitize_taxonomy_name', | |
function ( $urldecode ) { | |
return mb_substr( $urldecode, 0, 26, 'utf-8' ); | |
}, | |
10, | |
2 | |
); |