Woocommerce – Remove specific shipping method
-
Hey guys,
I’m pretty new to woocommerce and code snippets, I tried to write a small code to hide a specific shipping method when over 150€, but it doesn’t do anything.
29 is the ID that I got from the form (input value is mondial_relay_point_relais:29).add_filter('woocommerce_package_rates',function( $rates ){ $order_total = WC()->cart->get_subtotal(); if( $order_total > 150 ) { unset( $rates[29] ); } return $rates; } );
I set up the plugin and activated the php code in the public interface. I don’t know if I need to specify somewhere where the code needs to run.
Any help would be gladly accepted.
Thanks!
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Woocommerce – Remove specific shipping method’ is closed to new replies.