Untitled
unknown
plain_text
a year ago
474 B
5
Indexable
add_filter('b2bking_minmax_order_total_calculation_basis', function($val){
$cart = WC()->cart->get_cart();
$product_id_to_exclude = 1234;
$product_to_exclude_total = 0;
foreach ($cart as $cart_item_key => $cart_item) {
if ($cart_item['product_id'] == $product_id_to_exclude) {
$product_to_exclude_total += $cart_item['line_total'];
}
}
$value = (WC()->cart->cart_contents_total + WC()->cart->tax_total) - $product_to_exclude_total;
return $value;
}, 10, 1);Editor is loading...
Leave a Comment