Woocommerce Set Minimum Order For A Specific User Role

How To Set Minimum Cart Amount For User Roles In WooCommerce

As a software developer who often deals with support requests of all shapes and sizes, a satisfied client is my ticket to a good night’s sleep. But a loyal and a recurring customer is what makes me get up the next morning and strive harder, learning and bettering myself in the process.

Customer loyalty is sign of confidence that what you’re doing is right, and the people who you’re doing it for, they like and trust your work. And expect you to keep doing it. Shep Hykenwas absolutely on point when he said:

Image Courtesy: Pinterest

WooCommerceis an exceptional e-commerce platform when it comes to tapping into features that build trust among your customers, and bring returns in the form of recurring customers and of course, more sales.

One way to do this is to price your products differently for customers belonging to varying membership levels or groups, the principle that led to the creation of one of our most successful products. This actually works on two levels:

  • Setting low prices for recurring customers ensures more conversions; a customer would be more than happy to buy a product at a much lower price than his peers.
  • Advertising that such a scheme exists on your WooStore acts as an incentive for fresh customers to turn into loyal shoppers and thus avail the low price scheme.

Set Minimum Order Amount for User Roles In WooCommerce

As an extension to this practice, you may also want to set different cart value limits for customers belonging to different user roles. This is particularly useful for when your store sells products in wholesale, and you only want to allow a user to go through with the purchase if the order amount exceeds a predefined value.

Conversely, you may let the users of select user roles to purchase products on your store, no matter the order amount.

Here’s how you can map different user roles to a minimum purchase cart amount on WooCommerce.

Step 1: Cart Page Validations:

  • Go to wp-content/plugins/WooCommerce/templates/cartdirectory and look up for cart-totals.php file
  • Copy this file and go to your theme/child theme, create a folder WooCommerce/cart and paste cart-total.phpfile here.
  • The structure will be something like /wp-content/themes//woocommerce/cart/cart-totals.php
  • After copy pasting the file, open the file in the editor and look for the code line:
  • Replace the above code with the lines below.

Step 2: Checkout Page Validations:

From the above code snippet, we hide the Proceed To Checkoutbutton on cart page and add validations on cart page.

For the purpose of fool-proofing, we will also have to add the validations on checkout page, since a users with a little technical background could simply type in the URL of the page and bypass validations.

To do this, place the below code snippet in your themes -> functions.php file.

And that’s about it. Every user belonging to the specified user role will now be restricted to a minimum cart value while shopping on your website. Here’s how it would look in practice:

What’s amazing is that this needs not be limited to a single user role; play around with the code a bit and you can assign a minimum cart limit, and even create a settings page on the back end that would let you map user roles to minimum cart limits.


Found this article helpful? Let us know in the comment section below. Your feedback is what keeps us going. 🙂

I am looking for EXACTLY this type of action. Allow me to put a different spin on this…

I have a business that offers products to people within my LOCAL delivery area. Based on how far the customer lives, determines their minimum. I am considering managing this action via user roles (CustomerGroup1, CustomerGroup2, etc… where the minimum increases as the numeric value increases).

What I would LOVE to see is this: That alert that tells the customer they have a minimum order to fill is a floating value that appears across the entire site as the customer navigates through different products. One the $$ amount minimum is met, it lets them know that they can proceed to checkout.

I hope this post is still being monitored… Looking forward to someone replying that is a whole lot smarter than I am with coding.

how to combile 2 rules? one for each roles.

Thanks for offering this, but when I follow the instructions, this does not validate on my Checkout page. I’m still able to bypass my cart and checkout.

Stephen, I also thought that it did not work and that it really works.
When the wholesale customer clicks on the “pay” button, it is then when the error message occurs.

This is interesting. I am wanting to create a minimum purchase rule for various recurring purchases using Woosubscriptions. A monthly subscription and a bi-monthly subscription can be purchased in the same cart. I would like to require that each one of these meet the minimum. Is this possible. Thanks so much for sharing.

WordPress.org

Minimum Purchase for WooCommerce

The Minimum Purchase plugin for WooCommerce gives you the ability to set up minimum purchase rules for products in your WooCommerce 1.0+ store. Customer purchases must then meet these rules, to proceed to checkout payment.

If a purchase in your store fails a minimum purchase rule, an error message appears at the top of the checkout page, identifying the error situation and rule requirements. The customer must resolve the error, before the purchase can be completed.

FULLY TESTED with

  • WordPress 5.1+
  • Gutenberg
  • WooCommerce 3.5+
  • PHP 7.2

Show Error Messages on More Pages — New

  • You can now show error messages on all pages— select on Rules Options Settings page

Now with Repeating Groups and Custom Messaging!

  • Require purchasing minimum of 6, 12, 18, 24 ….
  • You can enter your own Custom Minimum Purchase Messages by Rule

Unparalleled Customer Service

  • Customer Service is as important as the plugin functionality itself
  • Support is open 7 days for questions and 1-on-1 assistance.

Introductory Video

How does the rule choose to examine the cart? [Search Criteria]

  • By Role/Membership for cart contents (allows different pricing rules for customer types / logged-in role, such as wholesalers or preferred customers).

Role/Membership Info for Search Criteria

Role/Membership is used within WordPress to control access and capabilities, when a role is given to a user. WordPress assigns certain roles by default such as Subscriber for new users or Administrator for the site’s owner. Roles can also be used to associate a user with a pricing level. Use a role management plugin like User Role Editor to establish custom roles, which you can give to a user or class of users. Then you can associate that role with a Minimum Purchase Rule. So when the user logs into your site, their Role interacts with the appropriate Rule.

How does the rule choose to examine the cart? [Search Criteria — Pro Plugin]

  • By cart contents
  • For a single product
  • For a single product’s variations
  • By Product Category or Minimum Purchase Category, and/or By Role/Membership

How is the rule applied to the cart search results? [Rule applied to]

  • All : work with the total of the units/prices
  • Each : apply the rule to each product in the Rule Population
  • Any : Same as each, but limits the rule testing to the first X number of products.

Rule Applies To Either:

  • Units Quantity Amount
  • Price Amount

A sample of a minimum purchase rule:

  • If the purchaser is a Subscriber — [search criteria:Subscriber]
  • The minimum total for all purchases — [rule applied to: all]
  • Must be greater than $20. — [price amount: $20]

Checkout Error Messaging

At checkout, the rules are tested against the cart contents. If products are found in error, an error message (in two possible locations) will be displayed. The error situation must be resolved, before the customer is allowed to leave the checkout and proceed to payment.

Error messaging css can be customized using the custom css option on the Rule Options Settings screen. There are also currency sign options, and a comprehensive debugging mode option.

Checkout Error Message Formats

  • Text-based descriptive format
  • Table-based format

Дополнительная информация

Additional Plugins by VarkTech.com

Pricing Deals Pro offers you complete flexibility creating pricing deals

  1. Buy two of these, get 10% off of both
  2. Buy two of these, get 10% off another purchase
  3. Buy two of these, get one of those free
  4. Pricing Deals of any sort, by Role/Membership
  5. etc….
  • Minimum Purchase Rule Screen
  • Group Search Criteria
  • Rule application method – Any
  • Rule application method – Each
  • Rule application method – All
  • Quantity or Price Minimum Amount
  • Error Message at Checkout

Минимальные требования

  • WooCommerce 1.0
  • WordPress 3.3+
  • PHP 5+

Install Instructions

  1. Upload the folder minimum-purchase-for-woocommerce to the /wp-content/plugins/ directory of your site
  2. Активируйте плагин используя меню ‘Плагины’ в WordPress

Часто задаваемые вопросы

Please review the following printed and video documentation.

WordPress.org

Description

The Minimum Purchase plugin for WooCommerce gives you the ability to set up minimum purchase rules for products in your WooCommerce 1.0+ store. Customer purchases must then meet these rules, to proceed to checkout payment.

If a purchase in your store fails a minimum purchase rule, an error message appears at the top of the checkout page, identifying the error situation and rule requirements. The customer must resolve the error, before the purchase can be completed.

FULLY TESTED with

  • WordPress 5.1+
  • Gutenberg
  • WooCommerce 3.5+
  • PHP 7.2

Show Error Messages on More Pages – New

  • You can now show error messages on all pages– select on Rules Options Settings page

Now with Repeating Groups and Custom Messaging!

  • Require purchasing minimum of 6, 12, 18, 24 ….
  • You can enter your own Custom Minimum Purchase Messages by Rule

Unparalleled Customer Service

  • Customer Service is as important as the plugin functionality itself
  • Support is open 7 days for questions and 1-on-1 assistance.

Introductory Video

How does the rule choose to examine the cart? [Search Criteria]

  • By Role/Membership for cart contents (allows different pricing rules for customer types / logged-in role, such as wholesalers or preferred customers).

Role/Membership Info for Search Criteria

Role/Membership is used within WordPress to control access and capabilities, when a role is given to a user. WordPress assigns certain roles by default such as Subscriber for new users or Administrator for the site’s owner. Roles can also be used to associate a user with a pricing level. Use a role management plugin like User Role Editor to establish custom roles, which you can give to a user or class of users. Then you can associate that role with a Minimum Purchase Rule. So when the user logs into your site, their Role interacts with the appropriate Rule.

How does the rule choose to examine the cart? [Search Criteria – Pro Plugin]

  • By cart contents
  • For a single product
  • For a single product’s variations
  • By Product Category or Minimum Purchase Category, and/or By Role/Membership

How is the rule applied to the cart search results? [Rule applied to]

  • All : work with the total of the units/prices
  • Each : apply the rule to each product in the Rule Population
  • Any : Same as each, but limits the rule testing to the first X number of products.

Rule Applies To Either:

  • Units Quantity Amount
  • Price Amount

A sample of a minimum purchase rule:

  • If the purchaser is a Subscriber – [search criteria:Subscriber]
  • The minimum total for all purchases – [rule applied to: all]
  • Must be greater than $20. – [price amount: $20]

Checkout Error Messaging

At checkout, the rules are tested against the cart contents. If products are found in error, an error message (in two possible locations) will be displayed. The error situation must be resolved, before the customer is allowed to leave the checkout and proceed to payment.

Error messaging css can be customized using the custom css option on the Rule Options Settings screen. There are also currency sign options, and a comprehensive debugging mode option.

Checkout Error Message Formats

  • Text-based descriptive format
  • Table-based format

Additional Plugins by VarkTech.com

Pricing Deals Pro offers you complete flexibility creating pricing deals

  1. Buy two of these, get 10% off of both
  2. Buy two of these, get 10% off another purchase
  3. Buy two of these, get one of those free
  4. Pricing Deals of any sort, by Role/Membership
  5. etc….

Screenshots

  • Minimum Purchase Rule Screen
  • Group Search Criteria
  • Rule application method – Any
  • Rule application method – Each
  • Rule application method – All
  • Quantity or Price Minimum Amount
  • Error Message at Checkout

Installation

Minimum Requirements

  • WooCommerce 1.0
  • WordPress 3.3+
  • PHP 5+

Install Instructions

  1. Upload the folder minimum-purchase-for-woocommerce to the /wp-content/plugins/ directory of your site
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

Please review the following printed and video documentation.

Leave a Reply

Your email address will not be published. Required fields are marked *