View Single Post
Old 06-09-2015, 05:35 PM
Cyril D's Avatar
Cyril D Cyril D is offline
Ecwid Team
Join Date: Feb 2015
Location: Ecwid HQ
Posts: 530


Thanks for your message! I'll be glad to help.

You can restrict access to a specific category using some CSS rules which will hide the products from the storefront, if a customer doesn't belong to a specific customer group, e.g., "Wholesalers".

Let's start from the beginning.

Creating customers groups is easy. Just go to the Ecwid control panel → Customers → Customer Groups, hit the "New customer group" button, specify the name for and save the changes.

Please note that the "Customer Groups" feature is available for paid Ecwid users only, starting from the "Business" plan. I didn't manage to find out your Ecwid account with the "Business" subscription, so, before utilizing this approach, you should upgrade your current account.

Then you should get two IDs: ID of the category you want to hide from other customers, and ID of the customer group which should be able to see products from that category.

The category ID can be found in browser's address bar when you open that category (see the below screenshot):

The customer group ID may be found like this:
  1. Create a test account in your store as a customer
  2. Add that account to the necessary customer group (Ecwid control panel → Customers)
  3. Use the "Inspect Element" function of your browser on any empty space
  4. Search for "customer-group" string in the code inspector
  5. Copy the digit-part of the found string — this is the group ID (see the below screenshot)

Ok, now you the necessary IDs. The next step is adding CSS rules to your custom theme in the Ecwid control panel → System Settings → Design → CSS Themes. Just copy and paste the following code:
div.ecwid-productBrowser-CategoryPage-CATEGORYID { display: none; }
body.ecwid-customer-group-GROUPID div.ecwid-productBrowser-CategoryPage-CATEGORYID { display: block !important; }
Replace strings marked in red with corresponding values and save the theme.

After these changes, the category that you specified in the CSS, will see only the customers from the certain customer group.

I hope this helps!

In case you have any further questions, feel free to ask them.
Cyril D.
Ecwid Customer Care Team

More tips and hints on Ecwid use in our Help Center

⬇ Please click Thanks if my reply helped you.