Contents
Using Profile Builder with WooCommerce
In order to use Profile Builder with WooCommerce you’ll need to have the following plugins installed and activated on your site:
- WooCommerce
- Profile Builder – version 3.8.0 or higher
Restrict Product Viewing
Restricting Product Viewing allows you to easily create user-only products, as well as allow only certain roles to view certain products. This feature combined with restricting product purchases offers you a ton of flexibility when it comes to presenting products to your users.
Let’s say we have already created 3 custom roles: Student, Parent, and Teacher. You can create custom roles using the Roles Editor feature.
After we set up the custom roles we need to set up our WooCommerce Products visibility. In our case, we have 4 products: Hoodie, T-shirt, Belt, and Sunglasses which are added in 2 categories: Clothing and Accessories.
When you edit a product, you will notice a new meta box called Content Restriction. Under the Display Options section, you will be able to setup the restriction for product viewing.
Inside the Display Options section we can set the following options:
- Type of Restriction
- Settings Default – It will use the default settings setup in PB -> Settings -> Content Restriction
- Message – It will display the default message setup in PB -> Settings -> Content Restriction or you can display a custom message for this product by checking the “Enable Custom Message” checkbox
- Redirect – It will redirect the user to the default link setup in PB -> Settings -> Content Restriction or you can use a custom redirect URL for this product by checking the “Enable Custom Redirect URL” checkbox*
- Display For
- Logged In Users – Checking only “Logged In Users” will show the product to all logged in users, regardless of User Roles
- User Roles created in WordPress Dashboard-> Users-> Roles Editor – Checking any Role will show this product only to users that have a certain user role
Notes
- The “Enable Custom Redirect URL” meta box is displayed only when the Redirect option is selected inside “Type of Restriction”
- The restrictions are not applied to the Admin role. Admins will be able to see the restricted products without having the appropriate User Role
Display product only to logged in users
To display a product to all logged in users, regardless of User Roles, you will need to check only the “Logged In Users” option.
View of product page for Logged Out Users
This is how the logged out user will see the product.
View of product page for Logged In Users
This is how the logged in user will see the product.
Display product only to members that have a certain role
To display a product to all users that have a specific User Role you will need to check the “Logged In Users” option and also the User Role that the restriction will be based on.
Note – Checking multiple User Roles, for example Student and Parent, will display the product to Student , Parent or Student and Parent users.
View of product page for Logged Out Users and without the Selected Role
This is how the logged out user will see the product.
View of product page for Logged In Users and without the Selected Role
This is how the logged in user that didn’t have the role that you have selected in content restriction will see the product.
View of product page for Users with the Selected Role
This is how the logged in users that have the role you have selected in content restriction will see the product.
Restrict Product Purchasing
Besides product viewing, you can also restrict product purchasing. This way you can allow only certain roles to purchase specific products.
When you edit a product, you will notice a new meta box called Content Restriction. Under the Purchase Options section you will be able to setup the restriction for product purchasing.
Inside the Purchase Options section you can set the “Who can purchase?” option to:
- Logged In Users – Checking only “Logged In Users” will allow the product to be purchased by all logged in users, regardless of Subscription Plan
- The roles that are created on your site – Checking any Role will allow the product to be purchased only by users who have that role
Notes
- The product purchase restrictions are not applied to the Admin role. Admins will be able to purchase the restricted products without having the appropriate Role
- You can simultaneously use the restrict product viewing option and also the restrict product purchasing option
Allow product to be purchased only by the logged in users
To allow a product to be purchased only by the logged in users, regardless of Role, you will need to check only the “Logged In Users” option.
View of product page for Logged Out Users
This is how the logged out user will see the product.
View of product page for Logged In Users
This is how the logged in user will see the product.
Allow product to be purchased only by a certain role
To allow a product to be purchased by the users who have a specific Role you will need to check the “Logged In Users” option and also the role(s) that will be able to purchase this product. The remaining roles will be restricted from purchasing it.
View of product page for Logged Out Users and and without the Selected Role
This is how the logged out users or members without the Student Role will see the product.
View of product page for certain role
Gold Members will see the “Add to cart” button and will be able to purchase this product.
Restrict Access to WooCommerce Shop Page
In order to restrict the access to the WooCommerce Shop page simply go to Pages -> All Pages, Edit the Shop page and scroll down until you see the Content Restriction meta box.
Inside the Display Options section we can set the following options:
- Type of Restriction
- Settings Default – It will use the default settings setup in PB -> Settings -> Content Restriction
- Message – It will display the default message setup in PB -> Settings -> Content Restriction or you can display a custom message for this product by checking the “Enable Custom Message” checkbox
- Redirect – It will redirect the user to the default link setup in PB -> Settings -> Content Restriction or you can use a custom redirect URL for this product by checking the “Enable Custom Redirect URL” checkbox*
- Display For
- Logged In Users – Checking only “Logged In Users” will show the product to all logged in users, regardless of User Role
- User Roles created in WordPress Dashboard-> Users-> Roles Editor – Checking any Role will show this product only to users that have a certain user role
Notes
- The “Enable Custom Redirect URL” meta box is displayed only when the Redirect option is selected inside “Type of Restriction”
- The restrictions are not applied to the Admin role. Admins will be able to see the restricted products without having the appropriate User Role
Display the Shop page only to logged in users
To display the Shop page only to logged in users, regardless of User Role, you will need to check only the “Logged In Users” option.
View of Shop page for Logged Out Users
This is how the logged out user will see the Shop page.
View of Shop page for Logged In Users
This is how the logged in user will see the Shop page.
Display the Shop page only to certain role
To display the Shop page to all members that subscribed to the users who have a specific Role you will need to check the “Logged In Users” option and also the User Role that the restriction will be based on.
Note – Checking multiple User Roles, for example Student and Parent, will display the product to Student , Parent or Student and Parent users.
View of Shop page for Logged Out Users and without a Certain Role
This is how the logged out users or members without the Student Role will see the product.
View of Shop page for Members
Logged in, Student Role will be able to see the Shop page, without any restrictions.
Restricted products inside the Shop page
As you noticed by now, using Profile Builder we can restrict the product viewing and also product purchasing. In the screenshot below, we restricted product viewing for the “Belt” product.
Shop page when a product viewing is restricted
You only see just the product title, without any details about price, description or thumbnail image. Also the “Add to cart” button is replaced by a “Read more” button.
Shop page when a product is visible, but purchase restricted
When a user role can view a product, but is not allowed to purchase it, he will be able to see all product details, just that the “Add to cart” button will be replaced with a “Read more” button. This way he won’t be able to purchase the product.
Profile Builder Pro
Create beautiful front-end registration and profile forms with custom fields. Setup member directories, custom redirects, cutomize user emails & more using the all in one user management plugin.
Unlock PRO Features