Minimum Order Total Except When Product Contains a Specific Word in WooCommerce

$75.00
Quick Demo

This PHP code enables you to set a minimum order amount so buyers can only complete the checkout process if the minimum total is equaled or exceeded unless they purchase a product which contains a specific word. If they do, they are exempt from the minimum order and can complete the checkout process.

In this example, the word is ‘PDF’ meaning any product title/name or variation name/description which contains the word PDF ( in upper or lower cases ), is exempt from the minimum order amount which in this case is set at $50.

The code checks the cart items subtotal to see if it meets the minimum amount and displays a message like this :

Below Minimum Order Total Disable Checkout

In the above case, the order cannot proceed to checkout as an error is displayed if the buyer tries to and is redirected back to the cart page as seen in the demo video.

Disable Checkout

If the cart contains a product with the word PDF or pdf, the minimum order amount is waived and the error notice is NOT displayed allowing the customer to complete the checkout process, as seen in the demo video.

Minimum Order Amount Exempt

Note : Works with single products and product variations using the variation name and/or variation description.

PHP Code Installation

  1. Copy & paste the PHP code to the end of your child themes functions file or custom code snippets plugin.

  2. Set the minimum order amount on line 21 and a comma separated string of words on line 27. In this case, to check for lower and uppercase.

Note : If you want to use the code to check for specific words in variation names and variation descriptions, use the code from functions-2.php.