Scriptfeeds Blog
  • Blog
  • WordPress
    • Woocommerce
    • WordPress Errors
    • WordPress Plugins
  • Development
    • WordPress Themes
  • Hire us
Cart / $0.00

No products in the cart.

No Result
View All Result
Scriptfeeds Blog
  • Blog
  • WordPress
    • Woocommerce
    • WordPress Errors
    • WordPress Plugins
  • Development
    • WordPress Themes
  • Hire us
Cart / $0.00

No products in the cart.

No Result
View All Result
Scriptfeeds Blog
No Result
View All Result
Home Wordpress

Free shipping above fixed amount in WooCommerce 2025

Scriptfeeds by Scriptfeeds
April 14, 2019
in Wordpress, Development
0
84
SHARES
Share on FacebookShare on TwitterWhatsapp this Blog

Adding free shipping above fixed amount in WooCommerce order is really cool. Customer get free shipping on particular orders, also its boost chances of more selling of products. In WooCommerce plugin, we can add free shipping above fixed amount orders in cart amount via plugin or code. We have an option to add free shipping or flat charges above fixed amount of orders in woo commerce.

Table of Contents

  • A condition for Free shipping above fixed amount
  • Solutions for adding Free shipping above fixed amount
    • In order to fix this we have two options :
    • To add code follow these simple steps to :

A condition

Consider a situation where you have to provide free shipping to customer on order above 100$ or 100₹ and below that you charge 5$ or 50₹ as flat shipping charge. To complete this scenario you have to add free shipping and flat rate attribute from shipping option in WooCommerce. Customer whose order above
100$ or 100₹ will get two option on checkout page to select :

  • Free shipping
  • Flat rate cart

This two option may create confusion for customer and may leave bad impression because both option can be checked (well nobody will select paid shipping if free shipping is there).

Solutions for adding Free shipping above fixed amount

In order to fix this we have two options :

  1. Install third party plugin
  2. Add a simple code in functions.php file

You can choose to install plugin but if plugin is poorly coded then it may slow down your checkout page which is not recommended (specially when you taking payment from customer). Also plugins make websites slow.

In second option, all you have to do it add a simple code in your functions.php file (In your child theme). If you add code in main theme functions.php file then you may loose code when theme will update.

To add code follow these simple steps to :

  • Login into your WordPress dashboard.
  • Go to appearance – select theme editor – click on ‘I understand’ option in popup.
  • on left hand side and select your child theme and click on select (where it says select theme to edit).
  • On same right side bar, click on functions.php file.
Free shipping above fixed amount
Steps to add code in function.php file
  • In text editor, add below code just above the end of php tage (?>).
  • After adding the code, click on save and go back to dashboard option.
/**
 * Hide shipping rates when free shipping is available.
 * work on WooCommerce above 2.6 Shipping Zones.
 *
 * @param array $rates Array of rates found for the package.
 * @return array
 */
 function my_hide_shipping_when_free_is_available( $rates ) {
	$free = array();
	foreach ( $rates as $rate_id => $rate ) {
		if ( 'free_shipping' === $rate->method_id ) {
			$free[ $rate_id ] = $rate;
			break;
		}
	}
	return ! empty( $free ) ? $free : $rates;
}
add_filter( 'woocommerce_package_rates', 'my_hide_shipping_when_free_is_available', 100 );
Free shipping above fixed amount - 2
Add code in functions.php file

Now you can check your cart by adding products above your specified amount, free shipping will be automatically updated in cart. Try the code and let us know how it goes. Any questions or queries ? Comment below or contact us for support

[caldera_form id=”CF60ca2e3ccf64f”]

Connect with Developer
Loading
Tags: free shipping above fixed amountfree shipping in wordpressfree shipping on woocommerce
Share34Tweet21Send

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I agree to the Terms & Conditions and Privacy Policy.

Scriptfeeds Blog

© 2022 Scriptfeeds

Blog Categories

  • WordPress
  • Development
  • Reviews
  • Marketing

Connect us on

No Result
View All Result
  • Blog
  • WordPress
    • Woocommerce
    • WordPress Errors
    • WordPress Plugins
  • Development
    • WordPress Themes
  • Hire us

© 2022 Scriptfeeds

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.