Hire us

$100.00 / hour

Pay on delivery

Satisfaction guarantee

12 months free support

  • 12 months free support
  • 30 days open purchase
  • Satisfaction guarantee

Restrict Categories

Chapter 1: Working with the Restrict Categories extension

This chapter will cover how to use the Restrict Categories extension in Magento.

1.1Restricting a category

This extension will add an extra tab in the category section of the administration panel (Catalog → Manage Categories).

Restrictions tab in category section

Under the Restrictions tab you will find a simple form where you can select which customer group(s) will be allowed to view the category.

From here you can also (if you wish to) specify which specific customers should be allowed to view the category, using their unique ID's (these can be found in the customer section of the administration panel, Customers → Manage Customers).

Additionally you can select whether or not you wish to restrict the products within the category as well.

Restriction tab form
Option Description
Allowed Customer GroupsSelect the customer group(s) which should be allowed access to the category (to deselect groups, press and hold CTRL (Windows/Linux) or CMD (OS X) key wile you click on the items you wish to deselect).
Allowed Customer IDsCustomer ID's, separated by comma (,). Example: 1,10,15,21,55
Restrict ProductsWhether or not to restrict the products within the category as well.

When you restrict a category it will become completely inaccessible (meaning that Magento won't load it at all) unless the client requesting it has been granted access to it. By making Magento ignore restricted resources we can guarantee that none authorised clients cannot view them.

When choosing to restrict products within a category it should be noted this works the same way. Magento will ignore the products, unless the client has access to them. This means the products won't show up in other categories, and will be excluded from search results and even custom product lists.

Chapter 2: Category Permissions configuration

This chapter will cover how to configure the Restrict Categories extension.

2.1Configuration overview

The configuration is accessible from the top menu System → Configuration on the tab MageParts → Category Permissions.

Configuration overview - category permissions
  1. 1) Navigate to System → Configuration in the top menu.
  2. 2) Click on the Category Permissions tab in the MageParts section of the left-hand menu.

2.2General Settings

General Settings
Option Description
EnabledWhether or not the extension is enabled.
Enable Debug LogWhether or not the extension should produce debug log entries.

Chapter 3: Permissions configuration

This chapter will cover how to configure the Permissions extension. This is the permissions engine Restrict Categories is based on.

3.1Configuration overview

The configuration is accessible from the top menu System → Configuration on the tab MageParts → Category Permissions.

Configuration overview - permissions
  1. 1) Navigate to System → Configuration in the top menu.
  2. 2) Click on the Permissions tab in the MageParts section of the left-hand menu.

3.2General Settings

General Settings
Option Description
EnabledWhether or not the extension is enabled.
Enable Debug LogWhether or not the extension should produce debug log entries.

3.3Cache Settings

Cache Settings
Option Description
Cache Tag TableTable containing modelcache tag relationships.

These values are used to clear cache in the permissions engine whenever the corresponding models are saved. For example, when a product is saved (catalog/product), the cache tag catalog_product will be refreshed.

While playing with these values won't cause any serious harm it's best to leave them alone unless you are sure of what you are doing.

3.4Redirect Settings

Redirect Settings

Redirect to Login Page

If a client isn't logged in and attempts to reach a restricted category or product, you can choose to have them redirected to the login page with an optional error message.

If a client is already logged in they will instead be redirected automatically to Magento native 404 page.

Redirect Table

Here you can specify what page to redirect clients to if they attempt to reach a restricted category or product page.

By default Magento will redirect them to the native 404 page (since the resource they are trying to access cannot be loaded by Magento as it's restricted to them).

Feel free to play around with the settings here, but make note of the default settings so you can revert any changes you make if necessary.

Chapter 4: Base configuration

There is an additional configuration section for Base, MageParts platform package including functionality shared between most of our extensions.

This section will not be explained here as it's experimental and should be left alone for the time being.

None of the settings in this configuration section will have any affect on the Restrict Categories extension (with the exception of the Enabled setting which should be left as Yes at all times. If you need to disable the extension please use the Category Permissions configuration section instead.)

Chapter 5: Troubleshooting

If restrictions aren't being applied properly (ie. the extension appears not to function properly and will allow access even to restricted categories) there are some things you can tests.

5.1Flattened categories & products

First ensure that flat categories and products are disabled. Navigate to System →Configuration in the top menu, click on Catalog in the left-hand menu and Frontend on the resulting page to expand the box containing the frontend catalog settings.

The settings which should be disabled are Use Flat Catalog Category and Use Flat Catalog Product. When active these options will modify how products and categories are loaded from the database to improve performance, sadly it will also mean restrictions cannot be properly applied.

5.2Varnish & FPC (Full Page Cache)

If you are running Varnish, or any FPC (Full Page Cache) solution you may also need to disable ot configure these to function together with this extension.

An FPC solution, or services such as Varnish, will store the output from a page request and return the same result to all subsequent requests to vastly improve performance. This is great so long as your pages should not render differently depending on who's viewing them.

If you restrict a category for example, it will appear in the top menu for some people but not for others, this means the same result cannot be returned to everyone.

Depending on your theme and cache solution you may however be able to configure it to function with our extension, you will need to consult your developer(s) for assistance since this is on a case-to-case basis.

If your developer(s) have any questions they may of course contact us for advise.

5.3Database query optimization & caching

If you have any database query optimization/cache solutions in place oyu may need to configure these to avoid the category and product tables in the database.

This is on a case-to-case basis and should only be done if there are any problems with the functionality of the extension (ie. restrictions aren't being applied properly).

If you need any advise you may of course contact us for assistance.

Restore forgotten password

An email will be sent to the email address you enter below containing a link to reset your password securely.

Create new account