WooCommerce how to set minimum order amount

 

Error Message WordPress Woocommerce

Error Message WordPress Woocommerce

 

To set the minimum cart total write the code into your functions.php file and change the variable value of $minimum_cart_total.

Here is the code to set a minimum cart total in WordPress woo-commerce

cart->subtotal; 
// Compare values and add an error is Cart's total     
// happens to be less than the minimum required before checking out. 
// Will display a message along the lines of 
// A Minimum of 10 USD is required before checking out. (Cont. below) 
if( $total <= $minimum_cart_total  ) { 
// Display our error message 
wc_add_notice( sprintf( 'A Minimum of %s %s is required before checking out .'.'
Current cart\'s total: %s %s', $minimum_cart_total, get_option( 'woocommerce_currency'), $total, get_option( 'woocommerce_currency') ), 'error' ); } } } ?>

Thanks for Reading.

Share The Post On -

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.