27 Ways to Improve Woocommerce Store

If you take a look around here on my site you’ll find ca 250 different Woocommerce related hacks. In this post I’ll show you 27 of my favorite Woocommerce cart page, checkout page and my account page related hacks. So, let’s take a look at the 27 ways how to improve your Woocommerce store.

One thing you need to know beforehand, though. If you don’t know where to add those snippets here below, then add them either to your child theme’s functions.php file or better yet, use a snippet manager like Code Snippets

There is also a WpCodeBox plugin, which is my favorite code snippets manager for WordPress. This is a premium plugin and if you’re interested, then grab WPCodeBox with a nice 20% discount here (SAVE 20% Coupon WPSH20).

Video: 27 Ways How to Improve Woocommerce Store

How to set Minimum Order Amount in WooCommerce?

With the help of this snippet here below we will set a minimum order amount in Woocommerce to 1000 euros and will display an error message on the cart and checkout pages if the conditions are not met (see the screenshot). Just replace the amount inside the code accordingly.

<span role="button" tabindex="0" data-code="// Set Minimum Order Amount in WooCommerce
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );

function wc_minimum_order_amount() {

$minimum = 1000; // Set this variable to specify a minimum order value

if ( WC()->cart->total

// Set Minimum Order Amount in WooCommerce
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
 
function wc_minimum_order_amount() {
    
    $minimum = 1000; // Set this variable to specify a minimum order value

    if ( WC()->cart->total < $minimum ) {

        if( is_cart() ) {
            wc_print_notice( 
                sprintf( 'Your current order total is %s — you must have an order with a minimum of %s to place your order ' , 
                    wc_price( WC()->cart->total ), 
                    wc_price( $minimum )
                ), 'error' 
            );
        } else {
            wc_add_notice( 
                sprintf( 'Your current order total is %s — you must have an order with a minimum of %s to place your order' , 
                    wc_price( WC()->cart->total ), 
                    wc_price( $minimum )
                ), 'error' 
            );

        }
    }
}

How to show “XX to free shipping” notification in Woocommerce?

It is a good idea to motivate your users to buy a bit more in order to get free shipping. This snippet here below will add this text to your cart “Buy XX€ worth products more to get free shipping”

How to show "XX to free shipping" notification in Woocommerce?
<span role="button" tabindex="0" data-code="// Show "XX to free shipping" notification in Woocommerce
add_action( 'woocommerce_before_cart_table', 'cart_page_notice' );

function cart_page_notice() {
$min_amount = 1000; //This is the amount of your free shipping threshold. Change according to your free shipping settings
$current = WC()->cart->subtotal;
if ( $current < $min_amount ) {
$added_text = '<div class="woocommerce-message"><strong>Buy ' . wc_price( $min_amount – $current ) . ' worth products more to get free shipping</strong>'; // This is the message shown on the cart page
$return_to = wc_get_page_permalink( 'shop' );
$notice = sprintf( '%s<a class="button" href="%s">%s</a>', $added_text, esc_url( $return_to ), 'Continue shopping

// Show "XX to free shipping" notification in Woocommerce
add_action( 'woocommerce_before_cart_table', 'cart_page_notice' );
 
function cart_page_notice() {
	$min_amount = 1000; //This is the amount of your free shipping threshold. Change according to your free shipping settings
	$current = WC()->cart->subtotal;
	if ( $current < $min_amount ) {
	$added_text = '<div class="woocommerce-message"><strong>Buy  ' . wc_price( $min_amount - $current ) . ' worth products more to get free shipping</strong>'; // This is the message shown on the cart page
	$return_to = wc_get_page_permalink( 'shop' );
	$notice = sprintf( '%s<a class="button" href="%s">%s</a>', $added_text, esc_url( $return_to ), 'Continue shopping</div>' ); // This is the text shown below the notification. Link redirects to the shop page
	echo $notice;
	}
}

How to display custom message to Woocommerce cart page?

Maybe you need to warn your customers that shipping is delayed or you need something elso to communicate. If so, then use this snippet and replace text accordingly.

How to add custom message to Woocommerce cart page?
<span role="button" tabindex="0" data-code="// Add custom message to Woocommerce cart page
add_action( 'woocommerce_before_cart_table', 'shop_message', 20 );
function shop_message() {
echo '<p class="woocommerce-message">Estimated delivery time: 2 weeks

// Add custom message to Woocommerce cart page
add_action( 'woocommerce_before_cart_table', 'shop_message', 20 );
function shop_message() {
echo '<p class="woocommerce-message">Estimated delivery time: 2 weeks</p>'; // Change this text
}

How to Update WooCommerce Cart on Quantity Change?

Next snippet is also a nice one. This allows you to hide Update cart button and it will update your cart amount every time you update product quantities. So, if you need to update WooCommerce cart on quantity change then use this snippet here below.

<span role="button" tabindex="0" data-code="// Update WooCommerce Cart on Quantity Change

add_action('wp_head', function(){

$css_code = <<<CSS

  • How to hide company field based on a Woocommerce custom checkout radio selection?
  • How to use Woocommerce coupons in 23 different ways? (23 simple hacks)
  • How to Customize Woocommerce Orders page? (20 hacks)
  • How to customize Woocommerce cart page? 21 useful Woocommerce Cart Page Hacks
  • How to Customize Woocommerce shop and category page? 17 useful hacks
  • How to customize Woocommerce Single Product Page | 14 Useful Hacks
  • How to Customize Woocommerce Checkout page? 28 useful hacks
  • How to customize Woocommerce Single Product Page | 14 Useful Hacks
  • How to Hide Woocommerce Shipping Methods (Conditionally) – 15 Hacks
  • How to Customize Woocommerce Stock Status? (17 hacks)
  • 24 Simple Woocommerce Hacks For Every Store

Leave a Comment

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

Scroll to Top