Ecommerce Shopify WordPress Discussion

WooCommerce Free Shipping Issue: Multiple Radio Buttons Dilemma on Orders Over free shipping price

I have set up a WordPress site with WooCommerce. My goal is to offer free shipping for orders over €75. On its own, it works fine, but I'm encountering a small issue. If I have a product that costs €30 in my cart and then add more products, bringing the total above €75, suddenly two radio buttons for free shipping appear, instead of just showing one for free shipping. If I then increase the quantity again, it goes back to displaying the correct output. This is my code: add_filter('woocommerce_package_rates', 'update_shipping_rates_based_on_total', 10, 2); function update_shipping_rates_based_on_total($rates, $package) { $price_limit = 75; // Check if the cart total is €75 or above if (WC()->cart->get_cart_contents_total() >= $price_limit) { // Set cost for free shipping foreach ($rates as $rate_id => $rate) { $rates[$rate_id]->cost = 0; $rates[$rate_id]->label = 'Gratis verzending'; } } return $rates; } // Clear shipping rates cache when the cart is updated add_action('woocommerce_after_cart', 'clear_shipping_rates_cache'); function clear_shipping_rates_cache() { WC()->shipping()->reset_shipping(); } Here are the images to make it clearer:
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.