How to Set Minimum Order Amount in WooCommerce – 2024

For many e-commerce businesses, setting a minimum order amount is a strategic move to increase average order values and ensure that each transaction covers the operational costs. In WooCommerce, setting up a minimum order amount can help you maintain profitability and reduce handling smaller orders that might not be cost-effective. In this guide, we’ll walk through how to set a minimum order amount in WooCommerce, using a simple function added to your theme’s functions.php file or a custom plugin.

Why Set a Minimum Order Amount?

Setting a minimum order amount can be crucial for managing shipping and handling costs effectively. It ensures that all orders meet a certain value threshold, which can help cover the costs and increase the average order size. This practice is especially useful for stores selling bulk items, offering wholesale rates, or even small businesses needing to maximize each sale for profitability.

Implementing Minimum Order Amount in WooCommerce

Implementing a minimum order amount in WooCommerce involves adding custom code to your site. This code checks the cart’s total and compares it to your specified minimum before allowing checkout.

Step 1: Add Custom Code

Open your WordPress dashboard, navigate to Appearance > Theme Editor, and select your theme’s functions.php file. Insert the following code at the end of the file:

 * Snippet: How to Set Minimum Order Amount in WooCommerce – 2024
* Author: John Cook
* URL:
* Tested with WooCommerce 8.8.3
*/ function wcsuccess_set_minimum_order_amount() { // Set the minimum order amount $minimum = 50; // Total we are going to be checking against $cart_total = WC()->cart->total; // Compare cart total to minimum order amount if ( $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( $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( $cart_total ), wc_price( $minimum ) ), 'error' ); } } } add_action( 'woocommerce_checkout_process', 'wcsuccess_set_minimum_order_amount' ); add_action( 'woocommerce_before_cart' , 'wcsuccess_set_minimum_order_amount' );

Step 2: Customize the Minimum Amount

In the code above, $minimum = 50; sets the minimum order amount to $50. You can change this value to whatever minimum you want to set for your store.

See also  Replace the Woocommerce gallery images with a YouTube video embed

How Does It Work?

The code hooks into WooCommerce actions related to the cart and checkout process. It checks the cart’s total against the set minimum and displays an error message if the total is less. The check occurs both when viewing the cart and attempting to checkout, ensuring customers are aware they need to meet the minimum order amount before proceeding.

Best Practices

When you set a minimum order amount, consider how it aligns with your business goals and customer expectations. Here are a few tips:

  • Communicate Clearly: Make sure your customers know about the minimum order amount by displaying this information prominently on product pages, the cart page, and during checkout.
  • Adjust as Needed: Monitor customer responses and adjust the minimum order amount if necessary to find a balance that works for your audience and your business needs.
  • Consider Exceptions: You might want to exclude certain products from the minimum order requirements or adjust the minimum during promotions.
See also  How to add a fee at WooCommerce checkout 2024


To set a minimum order amount in WooCommerce, you just need a snippet of code and a clear understanding of your business needs. By choosing to set a minimum order amount, you ensure that every transaction contributes positively to your business’s profitability and efficiency. Remember, the key is to keep your customers informed and to strike a balance that maximizes both customer satisfaction and your business objectives.

0 0 votes
Article Rating

Stay In Touch

Was this post helpful? Why not show your support and buy me a coffee?

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x
Scroll to Top