Untitled
unknown
plain_text
a year ago
525 B
11
Indexable
add_filter('b2bking_apply_fee', function($apply, $fee_name, $fee_data){
// Check if the chosen shipping method is 'local_pickup'
$chosen_shipping_methods = WC()->session->get('chosen_shipping_methods');
$local_chosen = false;
foreach ($chosen_shipping_methods as $method){
if (strpos($method, 'local_pickup') !== false) {
$local_chosen = true;
}
}
if ($local_chosen) {
if ($fee_name === 'fee test'){
$apply = false;
}
}
return $apply;
}, 10, 3);Editor is loading...
Leave a Comment