Hide a shipping method when cart is above a certain value
-
Hello, I am trying to hide a shipping method when cart total is above 100 this code used to work in regular woocommerce checkout:
add_filter( 'woocommerce_package_rates', 'remove_shipping_method_based_on_subtotal', 100, 2 ); function remove_shipping_method_based_on_subtotal( $rates, $package ) { $subtotal_threshold = 100; // Change this to your desired subtotal threshold $subtotal = WC()->cart->subtotal; // Subtotal incl taxes if ( $subtotal >= $subtotal_threshold ) { $targeted_rate_id = 'flat_rate:13'; if ( isset( $rates[ $targeted_rate_id ] ) ) { unset( $rates[ $targeted_rate_id ] ); } } return $rates; }
But is not working with Fluid Checkout Pro.
Can you guide me what hook can I use or what to do? thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Hide a shipping method when cart is above a certain value’ is closed to new replies.