Exclude gift cart product from calculates and apply discounts compatibility for YITH WooCommerce Gif
Exclude gift cart products from calculations and discount applications for YITH WooCommerce Gift Cards.
add_filter('advanced_woo_discount_rules_calculate_discount_for_cart_item', function ($calculate_discount, $cart_item){
if(isset($cart_item['ywgc_product_id']) && !empty($cart_item['ywgc_product_id'])){
$calculate_discount = false;
}
return $calculate_discount;
}, 100, 2);
add_filter('advanced_woo_discount_rules_include_cart_item_to_count_quantity', function($take_count, $cart_item){
if(isset($cart_item['ywgc_product_id']) && !empty($cart_item['ywgc_product_id'])){
$take_count = false;
}
return $take_count;
}, 100, 2);
add_filter('advanced_woo_discount_rules_process_cart_item_for_cheapest_rule', function($calculate_discount, $cart_item){
if(isset($cart_item['ywgc_product_id']) && !empty($cart_item['ywgc_product_id'])){
$calculate_discount = false;
}
return $calculate_discount;
}, 100, 2);PreviousInclude individually priced amount compatibility for WooCommerce Product Bundles by WooCommerceNextOnsale badge percentage compatibility for Satine Theme
Last updated