I'm trying to add an extra shipping cost for all the additional shipping fees that aren't calculated from the third party shipping company:
//add additional extra cost to shipping except for local pickup
add_filter( 'woocommerce_package_rates', 'shipping_extra_cost' );
function shipping_extra_cost( $rates ) {
foreach($rates as $key => $rate ) {
$rates[$key]->cost = $rates[$key]->cost + get_field('extra_cost', "51");
}
return $rates;
}
But then the additional fee is also added on local shipping which is wrong.
I can't work with WC shipping classes because that messes with the third party shipping calculation program.
Is there a way I can check if "local pickup" exists and then exclude the extra fee from it?