1. Documentation /
  2. Role & Customer Based Pricing by Meow Crew

Role & Customer Based Pricing by Meow Crew

Installation

↑ Back to top
  1. Download the .zip file from your WooCommerce account.
  2. Go to: WordPress Admin > Plugins > Add New and Upload Plugin. Choose File (for the file you downloaded in step 1).
  3. Install Now and Activate Plugin.

More information at: Install and Activate Plugins/Extensions.

Configuration

↑ Back to top

Role & Customer Based Pricing by Meow Crew allows you to configure pricing rules and set specific conditions for specific user groups and individual users.

Create Custom User Role 

Role & Customer Based Pricing extends the User management tool allowing you to add and remove (non-standard) User roles.

Note: the plugin doesn’t allow you to manage default role capabilities, you can only replicate capabilities from existing user roles. If you need to create a role with custom capabilities, you should use another plugin. Any WP role created with another plugin can be used for role-based pricing rules. 

To create a role, go to Users > Roles Management 

Enter the role name and select the role capabilities that the newly-created role will inherit.

If creating a role that does not require any special capabilities (such as administrator, editor, contributor roles capabilities), you can choose Customer to apply the default capabilities.

Default and custom role capabilities are described in the provided table below. 

You can delete any custom role from the list (WP default roles (administrator, editor, author, contributor, subscriber, customer, etc cannot be deleted).

Note: when you remove a role that is used in a pricing rule, the rule will remain active and apply the rule to all users until the rule is updated.

Next, you can then assign the user to the appropriate group under Users > All Users > {choose user account}.

Create General Pricing Rule

↑ Back to top

You can create role or customer-based pricing on two levels:

  • General rule – apply rule to selected products group, entire categories with option to set general pricing and/or quantity rules.
  • Product rule – apply rule to individual products.

To create general role-based or customer-based pricing and quantity rules, go to WooCommerce > Pricing rules.

In the Pricing rules table, you can view all of the created rules along with the status, applicable user role, discount value and min/max quantity.

The statuses include:

  • Active – rule is operational
  • Suspended – rule is paused (settings will remain)
  • Deleted – rule is trashed (settings will be lost)

If you need to disable the rule temporarily, it’s better to suspend it, so all of the settings made before won’t be lost. 

Note: the newest rules (at the top of the list) are prioritized over previous rules (at the bottom of the list). For example, if the same product or category is applied in two separate rules, the newer rule will override the previous one. 

Even if a pricing rule is not set but a quantity rule is created, this will still be considered the main rule. Pricing and quantity conditions should be applied within the same rule.

Select users and products

To create a new role or customer-based pricing rule, click on the Add Pricing Rule button.

Complete the following fields:

  • Rule Title – give the role-based pricing rule names to distinguish them from each other.
  • Apply for categories – choose the categories for which this pricing rule will apply. The rule applies to all products in the category.
  • Apply for specific products – if you don’t want to set pricing for the entire category or you need to add products in addition to the category, search for the product name here. No need to select products that are in the category you selected above. 
  • Include user roles – choose the user roles for which this rule will apply. It applies to all users with those roles. You can choose the newly-created ones as well as default WP user roles. 
  • Include specific customers – if the rule should apply only for certain customers, you can search for them in this field. If these users have the role specified above, no need to select them separately. 

Determine price and quantity rules

After setting the relevant user roles and categories/products, you can set pricing and quantity rules (if applicable).

  • Flat prices – set price to apply in rule.
  • Regular price ($) – option to set a certain price (leave blank to default to standard product price)
  • Sale price ($) – option to set sale price (leave blank to to default to sale product price)

Or 

  • Discount (%) – percentage discount. Note: if you have a sale price set for the product (available to everyone), discount will be calculated from that price. 

Please note that you are changing prices for a whole range of products or categories listed above.

  • Minimum quantity – set minimum amount of products that can be purchased by select user in a single order. If minimum allowed amount is 1, you can leave the field blank. 
  • Maximum quantity – set maximum amount of products that can be purchased by select user in a single order. If you don’t want to apply a limit, you can leave the field blank. 
  • Quantity step – option to set the quantity of product a customer can add to cart.
    • The screenshot above demonstrates when the min. required amount of products is 2 (you cannot buy 1) and the max amount is set to 20 (so you cannot buy 21 items), with quantity step of 2 products at the time (so you can purchase 2, 4, 6…18, 20 items, but not 3, 5, 7…17, 19).

The plugin also displays error messages if the user’s cart does not meet the rule conditions.

Create Separate Pricing Rule for Products

↑ Back to top

In addition to creating general rules for various user groups (roles or separate users) and entire categories or product groups, you can set up role or customer-based pricing on individual products. 

Note: pricing rules applied at the product level will override the general rule. For instance, if you have a general rule with a 20% discount applied to the entire clothing category but also have a product level rule with 10% off applied to the hoodie product, the 10% discount (not 20%) will apply to the hoodie product.

Simple Product

Simple, Variable, Grouped or Subscription products are configured identically. In the product metabox, you’ll find the the Role \ User pricing tab to set up Role and Customer-based pricing and quantity rules.

Role-based pricing

Here, you can configure role-based pricing for any user role in your store. Note: you can create only one rule per user role. 

To set up role-based pricing, select the appropriate user role from the dropdown menu and click Setup for role

Customer-based pricing:

Here, you can create pricing or quantity rules for separate user or user groups.

This feature allows you to create completely independent pricing for each product and every customer. 

Fields here are the same as in the general rules section: 

  • Flat prices – set price to apply in rule.
  • Regular price ($) – option to set a certain price (leave blank to default to standard product price)
  • Sale price ($) – option to set sale price (leave blank to to default to sale product price)

Or 

  • Discount (%) – percentage discount. Note: if you have a sale price set for the product (available to everyone), discount will be calculated from that price. 

Please note that you are changing prices for a whole range of products or categories listed above.

  • Minimum quantity – set minimum amount of products that can be purchased by select user in a single order. If you minimum allowed amount is 1, you can leave the field blank. 
  • Maximum quantity – set maximum amount of products that can be purchased by select user in a single order. If you don’t want to apply a limit, you can leave the field blank. 
  • Quantity step – option to set the quantity of product a customer can add to cart.
    • The screenshot above demonstrates when the min. required amount of products is 2 (you cannot buy 1) and the max amount is set to 20 (so you cannot buy 21 items), with quantity step of 2 products at the time (so you can purchase 2, 4, 6…18, 20 items, but not 3, 5, 7…17, 19).

Variable Product

Setting up role and customer-based pricing for Variable products is similar to setting up Simple products (above) however pricing and quantity rules are configurable for each variant independently. You have the option to set rules at the variation level by going to Product >  Variations > Choose Variation > Role or Customer-based metabox.

If you don’t require specific pricing for each variation, you can simply set up a general rule to apply to all variations of the product. 

Pricing Display and Rules for Non-logged In Users

↑ Back to top

Role and Customer-Based Pricing allows you to control the pricing display for non-logged in users. To configure, go to WooCommerce > Settings > Role\Customer Based Pricing

Prevent purchase for non-logged in users – option to restrict purchases to registered users. If you enable this option, next will appear: 

Error message when non-logged in users add to cart – Customize message to display to non-logged in users when they try to add a product into the cart.

Hide prices for non-logged in users – option to display or hide regular shop prices to non-logged in users. 

Add-to-cart label for non-logged users – option to customize the Add-to-Cart button text for non-logged in users.

Pricing: Display as – when the percentage discount pricing type is used, this option allows you to display the discounted price (as a sale price or normal price) for specific roles.

Import and Export

↑ Back to top

The Role & Customer Based Pricing integrates with the default WooCommerce import/export plugin allowing you to bulk import and export role-based prices, customer-based prices, and quantity rules. Note: this feature works only for pricing rules on the product level. It is not possible to create general rules using the import feature.

In addition, the plugin is compatible with WP All Import to facilitate import and export of role-based pricing rules.

WooCommerce default export/import

When exporting using default WP export, we recommend you first create a role-based or customer-based pricing rules for applicable products. Next, go to Products > All Products > Export.

You can select the fields pertaining to role or customer-based pricing as well as quantity rules.

After exporting the relevant fields, you can then use as a template to import your prices and/or quantity rules. Don’t forget to export some product identifiers (post id, SKU, product title). 

Your role-based pricing rules will display as shown below: 

Name: indicates the role for which you’re creating the rule. If you have a few rules for different roles, use ‘;’ separator to specify rules for two or more roles. In the example above, you can see how to set up pricing type for two roles: ‘Wholesaler S tier:flat;Wholesaler B tier:flat’.  

Role-based pricing type: (required field) indicates the type of role-based pricing you want to use for this product. Two options available:

  • flat – manually set up regular and sale price
  • percentage – percentage discount from the regular (or sale) product price. 

Role-based discount: required when percentage discount pricing option is selected. You can enter any number here between 1 and 100, which matches the discount you want to assign for this role. 

Role-based regular price: (optional field) if the product has a flat pricing option, then you need to indicate the regular price for the role here. 

Role-based sale price: (optional field) if the product has a flat pricing option, then you may want to set sale price in addition to regular product role-based price. 

Quantity rules: will display in the exported file as shown below (and surely, you can upload them in the same manner): 

Simply input the role name and set quantity values to create quantity rules. You can set up all 3 options here: minimum and maximum quantities available for purchase and quantity step.

To import prices for customer-based rules (separate rules for each customer), you need to know the customer ID.

As the customer ID is not available on the user page, you can manually enter in the user ID displayed in the address bar on the Edit User page: 

If needing to import in bulk, we recommend you either use the Reveal IDs plugin or export users w/ IDs via WP All Export or any other user export plugin you feel comfortable with.    

WP All Import integration

Role and Customer Based Pricing is integrated with WP All Import allowing you to mass import role-based pricing rules for each product. You can only import pricing rules based on user role. If you need to import prices for each user separately, you will need to use the WooCommerce Import tool (instructions in the section above). 

Also, note that the plugin isn’t integrated with WP All Export, so you cannot export role-based prices. 

The first thing you need to do is create an appropriate file for import.

The following fields are required in the file: 

  • a product identifier in the file (product ID for example); 
  • role-based pricing type (should be ‘flat’ or ‘percentage) for each role and each product;
  • for percentage discount pricing type, then enter the discount amount for each role and each product in the applicable fields
  • if you use flat prices, then input the regular price for each role and each product; 
  • in case you need sale prices in addition to regular prices, create an additional column for sale prices for each role and fulfill it for each product with a ‘flat’ type (the regular role-based price should be set beforehand) 

Your pricing section in the designated import file may look like this: 

In the example, you can see an import file for 2 products and two roles (S-tier and B-tier). The first column is their ID, which you need to create\update WooCommerce products; the next 2 columns represent pricing type, you can mix them up and even use two different pricing types for one product, but for different user roles; the next 2 columns are assigned discount for those roles (you can leave cells blank if you don’t use percentage pricing type); the next 4 contain regular and sale prices for those products for each user role. 

You can also include quantity rules in the file to import them along with pricing rules. 

The quantity rules may look like this in your import file: 

Column filling quantity rules are the same as for creating role-based pricing.

In that case, your quantity rules for the designated user role will be like this: 

To import the file, go to All Import > New Import > Upload, then choose to create brand new products or update current ones and then select WooCommerce Products in the “Import to”. 

Carefully check what fields to be uploaded from your file: 

You can find an additional block named ‘Role and Customer based pricing’, where all of your user roles are available to choose from:

Next, you need to select the Role for which you wish to import role-based prices and quantity rules. You can drag and drop all the fields from your import file into the role setup. Example below: 

Don’t forget to repeat the process for each role you wish to set up pricing and quantity rules for your WooCommerce products.

Read more detailed instructions on how to make product prices import here – How to import role-based product prices.

Troubleshooting

↑ Back to top

If pricing fields don’t automatically update after making adjustments, it may be related to caching. To clear the product price cache, go to WooCommerce > Status > Tools > WooCommerce transients > Clear transients. That will clear out the product/shop transients cache.

WooCommerce

The most customizable eCommerce platform for building your online business.

  • 30-day money-back guarantee
  • Support teams across the world
  • Safe and secure online payment