Skip to main content

% blog read

Setting a minimum order amount in WooCommerce

Dean Appleton-Claydon

By Dean Appleton-Claydon

25th Jul 2023

Web development
Setting a minimum order amount in WooCommerce

WooCommerce is a fantastic option for many small businesses looking to setup an easy-to-use website store. However just like any business, eCommerce comes with various challenges and often ask us to help navigate these obstacles everyday. 

One key challenge is striking a balance when setting a minimum order amount. While having a requirement can offer benefits, an excessively high minimum may discourage customers and lead to abandoned carts. Therefore, understanding your customer base and their shopping preferences is crucial in determining an appropriate minimum order amount for your WooCommerce store.

Factors in defining your minimum order amount 

Profitability. At the end of the day, selling a product has to be worth it for both parties – the seller and the purchaser. Selling with a very low profit margin and no minimums can be a risky strategy for a smaller business that may face challenges that affect their cash flow.

Processing and inventory. Often the admin side of eCommerce gets forgotten. It can be far more time-consuming and inefficient to pack smaller orders, with the added downside that it can make purchasing less predictable and more expensive (which also hurts profits).

Fees and shipping costs. Managing payment gateway fees and shipping costs is significantly more efficient at greater scale and a huge factor for smaller businesses.

Once you have factored in these areas and have a minimum order value in mind, the next step is to go ahead and implement this into your website.

Adding a minimum order value to WooCommerce

To set a minimum order amount in WooCommerce, you can either use a custom code snippet or a dedicated plugin. Below, I’ll explain both methods.

Using a Custom Code Snippet:

If you’re comfortable with adding code to your WordPress site, follow these steps:

Step 1: Access your WordPress dashboard and navigate to “Appearance” > “Theme Editor.”

Step 2: In the theme editor, locate the functions.php file on the right-hand side. This file is where you can add custom PHP code.

Step 3: Add the following code snippet to set a minimum order amount. Replace ’30’ with your desired minimum order amount:


function set_minimum_order_amount() {
    $minimum_amount = 30; // Replace this with your desired minimum order amount
    if ( WC()->cart->subtotal < $minimum_amount ) { 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->subtotal ), 
                    wc_price( $minimum_amount )
                ), '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->subtotal ), 
                    wc_price( $minimum_amount )
                ), 'error' 
            );
        }
    }
}
add_action( 'woocommerce_check_cart_items', 'set_minimum_order_amount' );
        

Step 4: Save the changes.

Now, if a customer tries to checkout with an order total less than the specified minimum amount, they will see an error message and won’t be able to complete the checkout process.

Using a Plugin:

If you prefer a more user-friendly approach without touching code, you can use a plugin like “WooCommerce Minimum Order Amount.” Here’s how:

Step 1: Go to “Plugins” > “Add New” in your WordPress dashboard.

Step 2: Search for “WooCommerce Minimum Order Amount.”

Step 3: Install and activate the plugin.

Step 4: After activation, go to “WooCommerce” > “Settings” > “General.”

Step 5: Scroll down to the “Minimum Order Amount” section.

Step 6: Enable the option to set a minimum order amount and enter your desired amount.

Step 7: Save the changes.

The plugin will now enforce the minimum order amount during the checkout process.

Choose the method that suits you best, and you’ll have a minimum order amount set up in your WooCommerce store.

Want to find out more?

Embark on a journey with us to transform your digital presence. Our collaborative approach ensures tailored solutions. Let's bring your vision to life together.
Get me started

Latest industry insights.

Explore the forefront of industry trends and innovations through our latest blogs where we unpack cutting-edge strategies, share expert perspectives, and keep you informed about the dynamic.
How do you know if an idea is a good idea?
08 May 2025

How do you know if an idea is a good idea?

We’ve been building a platform to solve the admin chaos agencies face – last week, we saw it strike a real chord.

Why choose Magento for your eCommerce business?
24 April 2025

Why choose Magento for your eCommerce business?

Looking for an eCommerce platform that can grow with your business? Magento might be the perfect fit.

Planning your next web project: when to redesign vs rebuild
17 April 2025

Planning your next web project: when to redesign vs rebuild

A well-planned web project starts by deciding whether to redesign for visual updates or rebuild for long-term scalability and performance.

We Create Digital Logo
Got a project in mind?