How to Hide Category for Customer Group in Magento 2
These days, many businesses with enormous potential go on the path of being hybrid companies that work in both areas: B2B and B2C. This goal is, for sure, achievable.
Still, it comes with a certain level of difficulty and complexity when it comes to inventory management.
If you intend to approach both 3 customer types (wholesalers, retailers vs. general shoppers) on a single eCommerce site, hiding specific product categories for customers is a “must.”
This post will explain why you should hide categories from certain customer groups and how to do that in Magento 2. Let’s dive in.
Table of Contents
- Why need to hide product categories from some customer groups?
- How to hide a Magento 2 category for customer groups
- The bottom line!
Why need to hide product categories from some customer groups?
There’re many reasons that sellers must hide some product categories from specific customer groups. One of them is the difference in pricing strategy between
Wholesalers vs. retailers vs. end consumers
VIP customers vs. first time purchasing customers
Wholesalers in different tiers
The shopping behaviors of these groups are also distinct. For instance, you might:
Consider hiding categories that require stock in vast quantities to wholesale customers
Create product categories for wholesale or VIP customers only with a much lower selling price. Regular or new customers won’t see these categories though
You work on both B2B and B2C spaces. Plus, each is interested in very different product types. To have a highly personalized and specific website, displaying product categories to the relevant group will be a good option
Restrict some specific categories when applying the tiered pricing strategy for wholesalers
It’s not a secret when buying wholesale products in bulk brings back tiered reductions on the purchases along with many other benefits. Still, the publication of wholesales prices is always not a wise choice in any situation.
How to hide a Magento 2 category for customer groups
Method 1: Use Magento’s built-in Category Permissions (CE version only)
Magento Commerce edition allows the store’s admin to hide product categories for specific customer groups with the Magento built-in Category Permissions.
Only customer groups with permissions can access the restricted categories through the main Menu, see the prices and make purchases.
Step 1: Create category permissions for customer groups
Magento developed this feature to be extremely user-friendly so that even merchants (with no coding experience) can configure it quickly at the backend.
To create a category permission at the backend, you need to access your Magento store’s backend. After that, find and select the following sections on the left sidebar: Store > Settings > Configuration > Category Permissions.
Restrict Access for specific customer groups
On the Category Permissions page, follow the below instructions:
Set Enable = Yes. This way, you can activate the Category Permissions and start working with from the store’s backend
Choose Allow Browsing Category = Specific Customer Group. A box, then, will appear (just below the Allow Browsing Category settings) corresponding to your selection
For Allow Browsing Category = For Specific Customer Groups, a box appears with 3 options: Not Logged In, General, Wholesale, and Retailer
Only the selected customer groups can browse and view your product categories. You can also choose multiple groups at the same time by holding down the Ctrl key (for PC) or Command key (for Mac).
Note: In case Allow Browsing Category = Redirect to Landing Page, you can create a redirection to any landing page for each store view.
Restrict the Price Display and “Add to cart” action
The settings go the same with the 2 next fields: Display Product Prices and Allow Adding to Cart. The admin can configure whether to display the product prices to specific customer groups or not and make purchases.
Set Display Product Prices = Yes, for Specified Customer Groups: Allow only members of particular customer groups to see the product prices in the category
Set Allow Adding to Cart = Yes, for Specified Customer Groups: Enable specific groups to make purchases of products in the categories
Plus, you can restrict the access permission of a specific customer group to the Catalog Search. In other words, the selected groups are not allowed to use the Catalog Search on your Magento site.
Once you’ve completed all the configuration steps of the Category Permissions, tap on the Save Config to save all your changes.
Step 2: Assign permissions to the targeted category
Above are all for the first step when you want to hide a product category from different customer groups using Magento’s built-in feature. With the newly created permission rule, now you need to choose a specific category to apply it to.
To do this, follow these steps:
Back to the Admin sidebar and navigate to the category tree by selecting Catalog> Categories
Click on the category that you want to apply the permission rule
Then, expand the Category Permissions tab **on the page. Then **choose the applicable Website and Customer Group
Set the individual permissions as needed. Click Save once you are done
In addition, you can create a new permission rule by clicking on the New Permissions button right under the rule grid. Undoubtedly, this Magento feature is no surprise, simple, straightforward, and easy to set up by non-tech-savvy people.
This is good news for Magento Commerce users, but not merchants who opt for Magento Open-source. The Category Permissions feature is only available for Adobe Commerce.
Method 2: Install a Magento extension
That’s why we need to come up with the second option by using a Magento 2 Catalog Permissions module. As it name suggested, a Catalog Permissions extension is developed to help merchants create multiple permission rule on their Catalog, such as:
Limit the access of some customer groups to specific categories
Hide products and statics page from different groups
Set valid time for catalog restriction or input the IP(s)/ IP range(s) to exclude from restriction - Features that Magento’s built-in Category Permission doesn’t support
Steps to hide a product category for customer groups:
Install Magento’s Catalog Permissions extension
Log in to your Magento account and go to: Stores > Configuration > Mageplaza > Catalog Permissions
On the General section, choose Enable = Yes to activate the module at your store’s backend
Scroll down to find and expand the Restrict Category section
Now, you can start configuring your wanted permission rule for the category restriction:
Select Enable = Yes to configure the settings for Restrict Category
Redirect To = CMS Page/ Specific URL: Here, you can choose the location to redirect members of the customer group with no access permission to
Hide Menu on the Frontend: For the Yes selection, customers can’t see the restricted categories on the storefront
Now, you have finished the configuration for the permission rule for product categories. To assign it to a specific category, you will need to:
Navigate to Catalog > Categories > Restrict Customers Group(s) section
Set Enable = Yes
Customer Groups = Not logged in, General, Wholesale, Retailer: Choose the groups that you want to hide that category from
You can also set the Redirect to option, start date, and end date for the restriction directly right on the Restrict Customers Group(s) page
Check out our detailed guide for the Magento 2 Catalog Permissions extension.
The bottom line!
Finding the balance point between the needs of your wholesale customers, retailers, and end customers is not an easy task. It’s essential to understand the shopping behaviors of these 3 buyer types and come up with clear guidelines for each to have sustainable growth.
If you’re looking for an effective solution to better manage store catalog element visibility, customize service, and improve the shopping experience, Mageplaza’s Catalog Permissions is a good choice.
Customization & Development Services?
8+ years of experiences in e-commerce & Magento has prepared us for any challenges, so that we can lead you to your success.Get free consultant