WooCommerce is one of the most popular eCommerce platforms on the web. Setting up a minimum order amount in WooCommerce is a great way to encourage customers to spend more money when they purchase from your store. In this article, we will show you how to enable minimum order amount in WooCommerce.
When it comes to setting up an online store, WooCommerce is one of the most popular eCommerce platforms available. While WooCommerce is great for many businesses, you may find that you need to set a minimum order amount in order to encourage customers to spend more money when they purchase from your store.
There are a few different ways that you can go about setting up a minimum order amount in WooCommerce. One way is to use a plugin, such as the Minimum Order Amount for WooCommerce plugin.
Another way is to add a snippet of code to your functions.php file. We will show you both methods in this article.
Method 1: Use a Plugin
There are many great plugins available for WooCommerce, and one of them is the Minimum Order Amount for WooCommerce plugin. This plugin allows you to set a minimum order amount for your store, and it also allows you to choose whether or not to display a notice to customers who do not meet the minimum order amount.
To use this plugin:
- Install and activate the Minimum Order Amount for WooCommerce plugin.
- Go to Settings » Minimum Order Amount.
- In the Minimum Order Amount field, enter the minimum amount that you want customers to spend in your store.
- In the Error Message field, enter the error message that you want customers to see if they do not meet the minimum order amount.
- Click on the Save Changes button to save your settings.
Method 2: Add Code Snippet
If you don’t want to use a plugin, then you can add a code snippet to your functions. You will need to use a text editor like Notepad++ or Sublime Text. Do not use the WordPress editor as it will strip out code snippets.
- Open your functions.php file and add this code snippet:
function wc_minimum_order_amount() {
$minimum = 10;
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(
}
}
}
add_action( 'woocommerce_checkout_process',
'wc_minimum_order_amount' );
- Save your changes and upload the file back to your server.
That’s it! You have successfully set up a minimum order amount in WooCommerce.
We hope this article helped you learn how easy it is enable minimum order amount in WooCommerce