Restrict WordPress plugin features integration with WooCommerce allowing you to use WooCommerce specific criteria to restrict the content. Surely, this can only work if the customer that is purchasing something through WooCommerce on your website is registered user. So, to make sure that is the case, you should navigate to WooCommerce Settings -> Accounts & Privacy tab and make sure that an option Allow customers to place orders without an account is unchecked as that will prevent customers from being able to purchase the product if they do not have an account. For convenience purposes, you can enable Allow customers to create an account during checkout and make it easier for them to create an account as part of the checkout process.
Here are all the options available with Restrict and WooCommerce installed on your website.
If you have WooCommerce installed on your website, you will notice that there is another tab within Restrict settings named WooCommerce.
In this area, you will be able to set the custom messages that will be displayed to the visitors that are attempting to view the content which is restricted based on WooCommerce based criteria.
When restricting the content of the whole page or post, you will notice that the Content Available To dropdown menu now contains another item named WooCommerce Users.
If you select this criteria, two additional options will appear:
When WooCommerce is installed and activated on the same website where you’re running Restrict, an additional area, named WooCommerce Users will be available in the Shortcodes tab of Restrict.
Within this area, you will be able to select WooCommerce related criteria to generate the shortcode. For example, you can require user to purchase any WooCommerce product or specific product(s) in order to access certain content. More details about using shortcodes can be found here.
Additionally, if needed, you can also add a custom message by using a protected_message argument as part of the shortcode. For example, your shortcode can look something like this:
[rsc_restrict_content allowed_to=”woo” woo_options=”anything” protected_message=”YOUR MESSAGE HERE”]Your content here[/rsc_restrict_content]
When creating new or editing existing post category, you will be able to select WooCommerce Users to restrict a whole category using WooCommerce specific criteria:
You can also restrict visibility of certain widget based on WooCommerce criteria. To do so, when creating new or editing existing widget you should select WooCommerce Users from the dropdown menu as displayed below:
This will be available for each widget on every available widget area of your website so you can control which WooCommerce users can see which widget.
Much like restricting widgets, you can restrict each menu item as well. While adding new or editing existing menu item, you can select WooCommerce Users from the dropdown menu and then select WooCommerce specific criteria required for the menu item to be displayed.