Restrict Coupons for B2B / B2C Users

Starting with B2BKing v2.5.0, a new "restriction" feature has been added to the coupon functionality. You can control which B2BKing groups, WP roles, or user categories can use a particular coupon. You can also use the keywords: "b2b", "b2c", "loggedout".

Here's how this works and how it can be used:

How to Set Up Coupon Restrictions #

In Marketing -> Coupons, you can add or edit a coupon and control restrictions through the "Usage restriction" panel:

Usage restriction panel

At the bottom of the panel, the plugin adds a new option called "B2BKing allowed options". If left empty, all users are allowed to use the coupon. However, if you specify certain options, only those specified will be allowed to use the coupon.

Here you can add WP roles directly (such as editor, administrator, etc.), and you can list multiple roles separated by commas. You can also use "b2b", "b2c", "loggedout", or "b2bking_group_123" to target a particular group.

If you use roles, they must be referred to by their slug, not their display name. For example, if you have a custom role called "VIP User", you would need to use its slug, which might be something like vipuser or vip_user.

How to Get the Group Name #

For B2B groups, the group name follows the format "b2bking_group_" + GROUP ID (e.g., b2bking_group_52, b2bking_group_8, etc.).

To find a group's ID, go to B2BKing -> Groups in the backend and click on the group. The number in the URL is the ID (e.g., if the URL shows ?post=1234, then the group ID is 1234).

Disable Coupons Completely for B2B #

It is also possible to remove coupon functionality completely for B2B users. To do this, go to B2BKing -> Settings -> Other and enable "Disable coupons for B2B users":

Powered by BetterDocs