Exclude force sell products compatibility for WPC Force Sells for WooCommerce
Ensure compatibility to exclude force sell products with WPC Force Sells for WooCommerce.
// Exclude force sell products compatibility for WPC Force Sells for WooCommerce
add_filter('advanced_woo_discount_rules_calculate_discount_for_cart_item', function ($calculate_discount, $cart_item){
if(isset($cart_item['woofs_parent_id']) && !empty($cart_item['woofs_parent_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['woofs_parent_id']) && !empty($cart_item['woofs_parent_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['woofs_parent_id']) && !empty($cart_item['woofs_parent_id'])){
$calculate_discount = false;
}
return $calculate_discount;
}, 100, 2);