(V5) Can I restrict part of all of a content page to a logged in customers only? Print

  • 0

Yes, the written content on a content page can be restricted to only users that have logged in who are in a particular user group. This is useful if you want to add extra information for VIP users or special content that only appears for a particular user group.

You can achieve this by using the Shortcodes feature built in to Ozcart. Here is what you do.

First, create your content page by going to Information > Pages and editing an existing page or creating a new one. When you're ready to add the content that you want to restrict, write the restricted content and wrap it in the [login] shortcode. It will look something like this in your information page:

[login msg_login="Wholesalers - please <a href='%s'>log in</a> to view this next section." group="2"]content[/login]

The group setting can be used to specify a particular customer group who will have access to this content. Note: this works the opposite way from the product category restrictions where you specify the customer groups who will be restricted, not the ones who have access.

How do you find the customer group identifier that goes into this code?
You can get the group identifier relatively easily. In the Store Admin menu, go to Customers > Customer Groups and click to edit the group who will have access. Then, look in the URL and record the customer_group_id figure that is shown. For example, in our demo shop, the Wholesale customer group has an ID number of 2, so you would use that in your shortcode (like the one shown above).







Was this answer helpful?

« Back