• WooCommerce Plugins
  • Support
  • Blog
  • About
  • FAQ
Menu
  • WooCommerce Plugins
  • Support
  • Blog
  • About
  • FAQ
$0.00 Cart

How to Display “Add $ X to cart and get free shipping” on Checkout

  • February 19, 2020
  • -
  • Lauri Karisola

Many stores have free shipping limit which gives free shipping to the customer when the cart subtotal exceeds certain amount. Free shipping limit is a great way to increase average order value. For example, if average order value is $ 75, you can try to set free shipping limit to $ 100 to increase AOV.

However, usually free shipping limit is not communicated clearly. If it’s only mentioned on the front page or in the terms and conditions, it’s likely the customer won’t see it in the first place.

Fortunately it’s easy to add “Add $ X to cart and get free shipping” message to the checkout with simple code. Here’s an example of the end result:

Example

Code

The code below adds the notice to the checkout. You can add the code with Code Snippets (recommended) or to functions.php file in the theme. You can change the limit on the line 9, by default it’s $ 50.

<?php
/**
 * Show free shipping limit notice on the checkout
 */
add_action( 'woocommerce_before_checkout_form_cart_notices', 'snippet_add_checkout_notice', 10, 0 );
function snippet_add_checkout_notice() {
	if ( is_checkout() && WC()->cart ) {
		$total = WC()->cart->get_cart_contents_total(); // Get cart subtotal after discounts
		$limit = 50.00; // Free shipping limit, change if necessary
		
		// If subtotal is less than limit, show notice
		if ( $total < $limit ) {
			// Calculate difference
			$diff = $limit - $total;
			$diff_formatted = wc_price( $diff );
			
			// Display notice
			wc_add_notice( sprintf( "Add %s to cart and get free shipping!", $diff_formatted ), 'notice' );
		}
	}
}

Latest Posts

How to Add Payment Method Fee in WooCommerce
Version 2 of Stock Sync – Migration Guide
How to Display “Add $ X to cart and get free shipping” on Checkout
How to Add Extra Shipping Charge For a Product
How To Disable WooCommerce Shipping Methods Based on Category

Plugins

WooCommerce Conditional Payments Pro
WooCommerce Conditional Shipping Pro
WooCommerce Product Sync Pro
WooCommerce Stock Sync Pro

WP Trio extensions make managing WooCommerce stores easier. Save time and get more sales with our premium plugins for WooCommerce. Should you have any questions, our support is happy to help!

WP Trio

  • Support
  • Blog
  • About
  • FAQ
Menu
  • Support
  • Blog
  • About
  • FAQ

Plugins

  • Plugins
  • Docs
Menu
  • Plugins
  • Docs