Home » WooCommerce: “You Only Need $$$ to Get Free Shipping!” @ Cart

WooCommerce: “You Only Need $$$ to Get Free Shipping!” @ Cart

by Tutor Aspire

This is a very cool snippet that many of you should use to increase your average order value. Ecommerce customers who are near the “free shipping” threshold will try to add more products to the cart in order to qualify for free shipping. It’s pure psychology.

Here’s how we show a simple message on the WooCommerce Cart page. Enjoy!

WooCommerce: get free shipping if you add "x" money
WooCommerce: get free shipping if you add “x” money

PHP Snippet: Show Remaining Amount to Reach Free Shipping Threshold @ WooCommerce Cart

/**
 * @snippet       $$$ remaining to Free Shipping @ WooCommerce Cart
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 3.9
 * @donate $9     https://tutoraspire.com
 */

add_action( 'woocommerce_before_cart', 'tutoraspire_free_shipping_cart_notice' );
 
function tutoraspire_free_shipping_cart_notice() {
 
   $min_amount = 50; //change this to your free shipping threshold
  
   $current = WC()->cart->subtotal;
 
   if ( $current %s %s', esc_url( $return_to ), 'Continue Shopping', $added_text );
      wc_print_notice( $notice, 'notice' );
   }
 
}

You may also like