View Product Page

Overview

YITH Role Based Prices allows to set and display different prices, discounts and markups per user role or per specific customers. For example, you can configure that standard customers get a fixed price for a specific product category, but resellers get a 50% discount on it. 

Role based prices frontend example

You can also configure which prices and information to show per user role. For example, users with the “Customer role” can see a table with all prices for each user role, meanwhile “Guest” users will have all prices and “Add to cart” button hidden. 

Additionally, the plugin offers customization options, such as personalizing and displaying a message in place of the price:

Guest user with price and add to cart hidden

How to create and apply price rules


In this post, we’ll explore how to create a pricing rule for an online clothing store that serves both retail customers and wholesalers. The goal is to offer one fixed price to regular customers and provide a special discounted price to wholesale buyers on all products (except for a specific category).

Step 1 — Rule options

Let’s start by setting up the Rule options. Go to the General settings tab and decide if you want the price rules to be calculated based on the regular price or the on-sale price (1):

(1) Rules options

Step 2 — Price rules

Now we can move onto creating our role-based prices rule. To start, go to the Price rules tab and click on “Create rule” button (2)

(2) Create rule

Then, set a name to identify your rule (3). Next, select if you want this price rule to apply to All products or Specific products. We decide to apply it to All products (4) but we want to exclude a specific product category, Accessories. So, enable the option “Exclude products” and select the category (5).

(3,4,5) edit price rule

The next step would be to set user options in the rule. You can choose if the rule applies to user roles or to specific users. We want ours to apply to roles (6).

And lastly, let’s set the values for each user role (7). Customers get a fixed increase on all products of $20 and resellers will get a 40% discount on all products instead.

(6,7) User roles and price values

Click on the “Save” button and we have our first price rule created!

Price rules list

Step 3 — Show a discount badge

If you want, you can display a badge to show your users how much they’re saving compared to the standard price. Enable it from the Customization tab > Extra options and customize colors (8).

(8) Customization badge

In the frontend, the badge would look like this:

Saving badge example

Step 4 — Display a price table and other user role’s prices

As an additional step, you can show a Price table and the prices available for other roles. First, activate the option from the Customization tab and set a title for the table (9).

(9) Enable price table option

Then, from the Users view tab, activate the Price table (10) for a specific role and add another role’s price for display in the product (11).

(10,11) Enable the price table and other user's role

Once everything is set, this is how it would display in the frontend:

Price table and role-based prices example

Customization options

From this tab you can configure options related to the labels and style in the plugin. Besides the Extra options to enable a badge and price table (as explained in this post) you can also configure:

Labels

Price label options
  • Regular Price text: add a label that will appear next to the regular price
  • On-Sale Price text: add a label to appear next to the on-sale price
  • Role Price text: decide a text to appear next to the price for the user role
  • Their price: write the text that users will see when showing the price of another user role. It is recommended if you want to encourage users to get a different role and buy at a better price
Price label options 2
  • Price Display incl. tax Suffix: text that will be shown when the price includes taxes
  • Price Display excl. tax Suffix: text that will be shown when the price excludes taxes
  • Alternative text shown to user: this text will be shown in place of the price if the regular, on sale and role-based price are set to hidden to a specific user in the User views
  • Alternative text position: select the position of the alternative text (before product name, before product price, before product excerpt, before Add to Cart, before meta and before sharing buttons)
  • Alternative text color: choose the color for the alternative text

Total discount/markup settings

Total discount and markup custom messages
  • Total discount message: this is the text that will appear below the role based price (if there is one set) that shows the discount the users with that role will see on the product. {ywcrbp_total_discount} is replaced with the total discount.
  • Total markup message: this is the text that will appear below the role based price (if there is one set) that shows the markup the users with that role will see on the product. {ywcrbp_total_markup} is replaced with the total markup.

Customize what price info users see

From the User views tab, you can see all user roles you have in your store and decide what price info to show to them. 

User views table
  • By default the plugin load all user roles, but you can also add and delete specific users from this table. To add a specific user, click on the “Add user” button (12)
(12) Add user button
  • You will see a modal window to choose the user and select the permissions
  • Once added, you can also activate and deactivate the available information from the table (13)
(13) User views options

Here is an example of what the user would see with the activated options:

Prices example