Groups/Dynamic Pricing

Groups/Dynamic Pricing

The way we assign groups to users for discounts be it members or special privileges groups is by using a Groups plugin. This, in conjunction with Dynamic pricing (see below), not only allows you to assign membership pricing for ad hoc purchases but also special groups such as family and friends or VIP's (who maybe don't want to be a part of the subscription club).

Each of our client sites generally has the same set up. In any of our KB articles, you find your set up is different and you need questions, please contact support. 

Access Control

Groups provides a built-in access control that allows restricted access to posts, pages, and custom content types to specific groups and their members.

Access to posts, pages and custom post types* such as products can be restricted by group. Any existing group can be used to restrict access and you can create as many different groups as needed to protect entries so that only members of the corresponding groups can view them.

*Many plugins define their own custom post types: products, events, topics, stories, slides, … you name it. We’ll simply refer to posts or entries here but the concept is extended to any of those kinds.


When read access to an entry is restricted by choosing one or more groups, only those users that belong to any of those groups can view it.

So how do you restrict access to an entry? You simply use the Groups box to choose one or more groups in the Read field it provides.

Please note that users with permission to Administer Groups can choose any group, while those who can only Restrict Access must be a member of a group to use it.


If no group is chosen in this field, the entry is visible to anyone.



If you choose at least one group, then the entry will be restricted. For example, let’s use a group named Premium to restrict access of an entry to members of that group only.



Choose the group and publish or update your post. Now if someone wants to view the entry, it’s required to be a member of this Premium group.
If you choose more than one group, to view the post it’s sufficient to be a member of at least one of those groups.
You can also create a new group directly from this field (permission to Administer Groups is required for this). Simply type the name of the group you want to create and use to restrict the entry.



Important Note: Unless you have permission to Administer Groups, in order to be able to use the group, your user account must be assigned to that group. Also, if you try to create a group that already exists and are not a member of that group, the assignment will fail. Group names are case-sensitive and if you create a group here, the first letter of each word will be capitalized.
A note on required permissions: To view and use the Groups box, you need to have the permission to Access Groups and to Restrict Access. If you do not have this access, please create a ticket in support.

Content Sections

With Groups, you can protect parts of your posts, pages and content from other post types. Instead of protecting an entry completely, you could show only parts of it. This makes the entry still visible to anyone but hides certain parts from normal visitors, users who don’t belong to the right group. In addition, you can also hide content from group members. Besides protecting parts of your content based on groups, you can also use capabilities to decide whether a section should be shown or not.

So, how is this done? You can edit your entries as usual – Groups allows you to limit the visibility of as many content sections as you like by simply enclosing them within shortcodes.

The shortcodes that are involved are [groups_member], [groups_non_member], [groups_can] and [groups_can_not].

Let’s have a look at a simple example:

Here's some unprotected content.
Anyone can see this.

[groups_member group="Registered"]
But this section is different, only registered users will see this.
[/groups_member]

Here's some more content which anyone can see.

[groups_member group="Premium"]
And this section is shown only to users in the Premium group.
[/groups_member]

Please copy the above and paste it on page. Now visit the page while logged out (you can simply use another browser than the usual one) and you will see the content is limited. Now log in as a normal user or if you have created the Premium group, log in with an account that belongs to it. In both cases, you will see more based on the account’s membership.

This is what our editor shows after pasting the example on a new page (if you are using the Visual Composer you will need to add the shortcode to a text element) (if you are using Custom Fields you can add the shortcode to a text Customer Field) :



For someone who is not logged in, this is what the visitor will see:



The content section that is protected and only shown to registered users who are logged in will show more. A registered user will see the protected content section:



And a member of the Premium group will see everything:




You can use as many instances of the shortcodes used to protect content sections on the same page and on as many entries you want.
You can also nest shortcodes as long as they are different. You can’t nest two instances of the same shortcode because the way these are interpreted by WordPress is limited. This is true for any shortcode, not just those provided by Groups. Anyhow, here’s an extended example with different shortcodes, including a nested section:

Welcome!
[groups_non_member group="Registered"][groups_login][/groups_non_member]
[groups_member group="Registered"]
You are connected!
[groups_non_member group="Premium"]
Why don't you join the Premium group?
[groups_join group="Premium"]
[/groups_non_member]
[groups_can capability="manage_options"]You've got the power![/groups_can]
[groups_logout]
[/groups_member]

This is how it looks like in our editor:



That’s how the page will appear to a simple visitor:



And here is what a registered user sees:



What a Premium member sees who also has the manage_options capability:



We understand our clients may not understand some of the more technical aspects of using Shortcodes to restrict content. We suggest duplicating a page on your site and trying it out. If you have any further questions or answers to some issues you are experiencing please raise a ticket through support. We will endeavour to update this article with real-world examples as our clients start using this feature more.  

Assigning and un-assigning Groups to Users

The group memberships of your site’s users can be managed directly from the WordPress Dashboard through the Users menu.

User accounts can be assigned to any group and they inherit the capabilities of the groups they belong to.

All users are automatically added to the Registered group. This provides a convenient way to open up content to registered users only, without the need to create any specific additional groups.

From the WordPress Dashboard, you can modify the group memberships of your users using the bulk actions on the Users > All Users page, or on individual user profile pages, if the option Show groups in user profiles under Groups > Options > User Profiles is enabled.

Bulk actions


You can manage the group memberships of your users directly from the usual Users menu on the WordPress Dashboard.

Go to Users > All Users – here you can filter the list of user accounts by group and you can add your users to any groups or remove them.
Convenient fields are provided so that you can do this for multiple users and multiple groups at once.




For a quick and convenient way to display only members of a certain group, a Filter button and its selection field that allows to select multiple groups is available on top of the Users table. For each group, the current number of members is displayed. To search for a group, you can start typing the group’s name and the selection of groups is reduced to those matching.



By default, filtering by one or more groups will include users who belong to any of the chosen groups. If you would like to include only users who belong to all of the chosen groups, use the intersection checkbox:



With the Group Actions provided, you can add multiple users to one or more groups here at once. The corresponding selection field can be used to remove multiple user accounts from one or more groups at once.



The Group Actions are applied to the users that are selected in the table of users below.

Group Actions include the option to add one or more users to one or more groups, or to remove these users from one or more groups. The groups to which users should be added to (or removed from) must be chosen in the field that indicates Choose groups …

Example: Let’s assume that you want to add two user accounts to the Premium group.
  1. Select the users you want to include.
  2. Input or select the Premium group in the field Choose groups ….
  3. In the Group Actions dropdown select Add to group.
  4. Click the Apply button.



After you have clicked Apply, you will see that the desired users have been assigned to the selected group.



Dynamic Pricing

Dynamic Pricing plugin is primarily used to provide members or VIP's (Using Groups) discounted prices to products when they are logged in.
This is different from the way the first wine club sign up or ongoing wine club payments are discounted. 
Dynamic pricing can be set on the global level (for all products) or on the individual product level. We prefer setting it up on the individual level so that double discounts will not occur if a 'special' product/pack is created with a built-in lower price. The member would be able to log in, have their global discount apply on top of the 'special' price. 

Dynamic Pricing for Groups (Members and Special Groups)


To set a dynamic price on a product,
  1. Click into the product you want to set it for and scroll down to the Product Data area
  2. Click on the 'Dynamic Pricing' tab
  3. Select 'Groups' from the dropdown
  4. Specify your discount (can be dollar value discount, percentage or a fixed price)
Click on 'Add Pricing Group' to create dynamic pricing for other Groups you have set up. 

This data carries over when duplicated a product
These instructions are for setting dynamic pricing for Groups (members, VIP's). For other ways to use Dynamic Pricing please see below:

Single product pricing

Set up an advanced pricing rule for a specific product.

Go to: Product > Product X (the product you wish to set a rule for).

Next, go to: Product Data > Dynamic pricing.

Select Add Pricing Group.

There, configure the conditions for the rule.

  1. Applies To: You can choose to apply this to ‘Everyone’, or to ‘Specific Roles’. Choosing ‘Specific Roles’ allows you to select the roles that the customer must be a member of for the rule to apply.
  2. Quantities based on:
    1. Product Quantity: Quantities will be totalled based on the Product ID. If the product is a variable type product, this option will use each variation that has been added to the cart to calculate the total quantities and will apply the price adjustment to all variations.
    2. Variation Quantity: Quantities are totalled based on the Variation ID. The price adjustment is applied to the specific variation in the cart.
    3. Cart Line Item Quantity: Quantities are based on the individual cart item. This is useful if you are using Product Add-ons or Gravity Forms to allow additional data to be added to the cart need to apply discounts to specific line items in the cart.
    4. Quantity of Category: Selecting this option gives you the ability to select categories to use to build the price adjustment. This is useful if you would like to give a specific product a discount when X number of items from a product category has been added to the cart.
  3. Rule Processing Mode: ‘Bulk’ will apply the rule on all items, ‘Special Offer’ to a predefined amount.
  4. Dates: Define a date range for when the prices should be applied.
Finally, the table rates with the pricing rules need to be defined. These will differ slightly if you’ve chosen ‘Bulk’ or ‘Special Offer’.


  1. Bulk
    1. Minimum Quantity: This is the minimum amount that must be in the cart for the specific price adjustment to apply. Use 0 for the minimum quantity to force the discounted price to be displayed in the catalogue before the user adds the item to the cart (since v. 1.3.1).
    2. Max Quantity: Quantities in the cart must be less than or equal to this amount for the specific adjustment to apply. You can use a * to create an unlimited upper bound.
    3. Type: The type of discount to apply. Price discount will discount by the exact amount you enter, percentage will discount by the percentage, and fixed price will fix the price ‘per item’ to what you enter.
    4. Amount: The amount to discount.
  2. Special Offer
    1. Purchase: This is the amount of items the customer needs to purchase to get the discount.
    2. Receive: This is the amount to which the discount should apply.
    3. Type: The type of discount to apply. Price discount will discount by the exact amount you enter, percentage will discount by the percentage, and fixed price will fix the price of the item to what you enter.
    4. Amount: The amount to discount.
    5. Repeating: ‘No’ will only give this discount once, ‘Yes’ every time the rule is met.
The ‘+’ symbol at the end of each line in the table rate can be used to add more rules.

You can create several pricing groups per product. The rules will be evaluated from top to bottom; as soon as the rule is matched, the processing of other rules will stop.

Select Update to update your product.



Please note: Anytime you are setting up new pricing rules, please test thoroughly as both a logged out, logged in as well as member and non-member.

For the full Dynamic Pricing Documentation, please visit https://docs.woocommerce.com/document/woocommerce-dynamic-pricing/