My Cart

User Manual - Customer Group Catalog Permissions

Magento 2 Customer Group Catalog Permissions is equipped with rich functionality in the backend and easy to implement functionality in the frontend. The backend includes both individual and mass settings. The individual ones allow an admin to set the permissions for each category, product and CMS page separately. Mass settings provide the opportunity to configure and delete permissions for the unlimited number of store catalog elements at once.

Both individual and mass settings are aimed at visibility management of the element itself, its price and add to cart button. More to that, it’s possible to assign text messages equipped with CSS-styles and configure the redirection instead of hidden elements.

 

 

Installing Customer Group Catalog Permissions 

Command Line Installation

  1. Backup your web directory and store database
  2. Download the Customer Group Catalog Permissions  installation package
  3. Upload contents of the Customer Group Catalog Permissions installation package to your store root directory
  4. In SSH console of your server navigate to your store root folder:
cd path_to_the_store_root_folder

run the following command: 

php bin/magento module:enable Aheadworks_CustGroupCatPermissions

php bin/magento module:enable Aheadworks_CustGroupCatPermissionsGraphQl

then:

php bin/magento setup:upgrade

after:

php bin/magento setup:static-content:deploy -f

     5. Flush store cache; log out from the backend and log in again

Make sure the installation is done from the FTP administrator account. Otherwise, set 775 permissions to the store root directory after the extension is deployed.

Composer Installation

If you are installing an extension from Aheadworks for the first time, you need to add our composer repository to your Magento store:

     1. Login to your ssh console and navigate to your store folder:

cd path_to_the_store_root_folder

Run the following commands:

composer config repositories.aheadworks composer https://dist.aheadworks.com/

On successful execution of the commands you will be able to use the composer to install the extensions.

To install the extension:

     2. Login to your ssh console and navigate to your store folder:

cd path_to_the_store_root_folder

     3. Run the following command to install the latest version of the extension:

composer require aheadworks/module-customer-group-catalog-permissions

if you need to install a specific version, run this command:

composer require aheadworks/module-customer-group-catalog-permissions:<version>

 

Specify the version of the extension in <version>

When prompted, enter Public Key (Username) and Private Key (Password):

Public Key (Username) and Private Key (Password) | Customer Group Catalog Permissions for Magento 2

Both Public Key (Username) and Private Key (Password) can be found in My Projects and Licenses in your personal account on our site:

Access keys management | Customer Group Catalog Permissions for Magento 2

Run the following command to install Customer group catalog permissions GraphQl:

composer require aheadworks/module-customer-group-catalog-permissions-graph-ql

     4. Enable the extension:

php -f bin/magento module:enable <Module_Name>

php -f bin/magento module:enable Aheadworks_CustGroupCatPermissionsGraphQl

 

Add the product name in <Module_Name>

Next, register the extension:

bin/magento setup:upgrade

Recompile your Magento store if you are in the Production mode:

bin/magento setup:di:compile

To verify that the extension is enabled, run this command:

bin/magento module:status

Clean store cache, by running the following command:

bin/magento cache:clean

Log out and Log in the backend again.

Want to use the  Hyvä theme module?

To install the Hyvä theme module, you need to install the module via composer using command:

composer require hyva-themes/magento2-aheadworks-customer-group-catalog-permissions

To upgrade the extension:

     5. To update or upgrade an extension:

Download the updated extension file. Take note of the module-name and version. Export the contents to your Magento root.

If a composer package exists for the extension, run one of the following.

Update per module name:

composer update aheadworks/module-customer-group-catalog-permissions

Updater per version:

composer require aheadworks/module-customer-group-catalog-permissions:<version>

Run the following commands to upgrade, deploy, and clean the cache.

php bin/magento setup:upgrade --keep-generated
php bin/magento setup:static-content:deploy
php bin/magento cache:clean

 

Uninstalling Customer Group Catalog Permissions

Since Magento introduced declarative Database you need to be very carefull when uninstalling or disabling the module.

NOTE: Please be very careful when uninstalling/disabling this module. This module uses a declarative DB scheme. Once the module is uninstalled the DB tables will be lost.

Manual Removal

1. Disable the module by executing the following commands:

php bin/magento module:disable Aheadworks_Customergroupcatalogpermissions 
php bin/magento setup:upgrade

2. Remove the extension files from the following folder:

app/code/Aheadworks/Customergroupcatalogpermissions

Automatic Removal (via Composer)

1. Disable the module by executing the following commands:

php bin/magento module:uninstall Aheadworks_Customergroupcatalogpermissions

 

 

 

 

Compatibility

Module Version 

Magento Version 

PHP 

1.0.10  and earlier versions

2.3.Х - 2.3.6

2.4.0 - 2.4.3

7.4 and earlier versions

As of version 1.0.11

2.3.7-p3+

2.4.0 - 2.4.5

7.4, 8.1

As of version 1.0.12 and later

2.4.4 - 2.4.6

8.1

 

 

 

 

Introducing M2 Customer Group Catalog Permissions 

Business Advantages

Magento 2 Customer Group Catalog Permissions allow you to divide catalogs between specified customer groups keeping website performance streamlined. In particular, it is possible to hide categories, individual products, CMS pages from any customer group both individually and massively. Also, you can hide price and ‘add to cart’ buttons and replace them with customizable text messages. Finally, this Magento 2 user permissions extension allows you to assign redirect pages for those customers who are allowed to access some hidden website content.

What Makes the module Different

  • Divide catalog content between wholesalers and retailers
  • Hide CMS pages from the specified customer groups
  • Redirect your customers to any pages
  • Show customized text messages instead of hidden price and/or add to cart button
  • Apply permissions individually and in bulk

Integrations

What's new?

The latest version of the extension (1.1.1) enables the following:

  • GraphQL support

 

Backend Configuration

Magento commerce

Note that firstly, you need to disable native permissions to launch the Customer Group Catalog Permissions by Aheadworks.

1. General Configuration

General Configuration | Customer Group Catalog Permissions for Magento 2

The Configuration page of the extension (Stores Configuration Aheadworks Extensions Сustomer Group Catalog Permissions) includes three sections: General, Catalog Elements Permissions, and CMS Page Permissions.

The General section of the General configuration page allows you to enable the extension via choosing the option ‘Yes’.

Catalog Elements Permissions - section of the Configuration page contains the following configuration options:

Browsing Catalog Elements - the field to be used for the needed mode for the element visibility to be chosen: Show for everyone, Hide from specified customer groups or Hide from everyone;

The Browsing Catalog Element field will hide everything (products and categories), then you need to open products/categories one-by-one or mass action.

General Configuration | Customer Group Catalog Permissions for Magento 2

Note that if you choose mode ‘Hide from specified customer groups’, the following fields appear:

Customer Groups - the field to be used for you to choose the definite customer groups;
Redirect Visitor to This Page - the field to be used for you to insert the URL page for redirection those customers who reach the hidden browsing catalog element;
Display Product Price - the field to be used for the needed mode for the price visibility to be chosen: Show for everyone, Hide from specified customer groups or Hide from everyone.
Allow Adding to Cart - the field to be used for the needed mode for the add to cart button visibility to be chosen: Show for everyone, Hide from specified customer groups or Hide from everyone.

General Configuration | Customer Group Catalog Permissions for Magento 2

Note that if you choose mode ‘Hide from specified customer groups’ for these two fields (Display Product Price and/or Allow Adding to Cart), the following fields appear:

Customer Groups - the field to be used for you to choose the definite customer groups;

Text Message When Price Is Hidden - the field to be used for you to insert a customized text message using a ready-made HTML-code.

Text Message When Button Add to Cart Is Hidden - the field to be used for you to insert a customized text message using a ready-made HTML-code.

To display the Hidden Add To Cart Message in the places where the Add To Cart button is displayed, you need to add the following code to the corresponding template:

<?php if ($_product->getHideAddToCart()):?> 
<?= /* @escapeNotVerified */ $_product->getHiddenAddToCartMessage(); ?>
<?php endif; ?>

where $ _product is the product object in the template.
Examples
For the Product page:

vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml

For the Category Page:

vendor/magento/module-catalog/view/frontend/templates/product/list.phtml

This code is added wherever it is necessary to display the message and the product object ($ _product) is defined.

 

To hide the unwanted text 'Out of stock' when the product permissions are applied, you should:
1) open the template with the output of this text
2) find this text and wrap its output with a conditional construction.

<?php if (!$_product->getHidePrice() && !$_product->getHideAddToCart()):?> 
... the output of the text "Out of stock"
<?php endif; ?>

As an example, changes in the vendor / magento / module-catalog / view / frontend / templates / product / list.phtml template:

before:

<?php if ($_product->isAvailable()):?> 
<div class="stock available"> <span> <?= /* @escapeNotVerified */ __('In stock')?> </span> </div>
<?php else:?>
<div class="stock unavailable"> <span> <?= /* @escapeNotVerified */ __('Out of stock')?> </span> </div>
<?php endif; ?>

after:

<?php if ($_product->isAvailable()):?> 
<div class="stock available"> <span> <?= /* @escapeNotVerified */ __('In stock')?> </span> </div>
<?php else:?>
<?php if (!$_product->getHidePrice() && !$_product->getHideAddToCart()):?>
<div class="stock unavailable"> <span> <?= /* @escapeNotVerified */ __('Out of stock')?> </span> </div>
<? php endif; ?>
<?php endif; ?>

Static Pages -  the field to be used for the needed mode for the CMS page visibility to be chosen: Show for everyone, Hide from specified customer groups or Hide from everyone.

Note that if you choose mode ‘Hide from specified customer groups’, the following fields appear:

Customer Groups - the field to be used for you to choose the definite customer groups;

Redirect Visitor to This Page - the field to be used for you to insert the URL page for redirection of those customers who reach the hidden CMS page. Finally, note that these settings are applied to the whole store catalog without dividing it into separate categories, products, or CMS pages. More to that, the settings configured are applied as the default unless other individual ones are specified.

That's it. The configuration is done.

2. Category Permissions (individual settings)

Category Permissions | Customer Group Catalog Permissions for Magento 2

If you want to set the permissions for the individual category, you need to reach the New Permission fieldset. The fieldset is available through the following path: Сatalog Categories Needed Category chosen from the Category tree Category Permissions by Aheadworks New Permission and includes the following columns:

Store View - the website which will be the application scope for the permissions specified;
Customer Group - the particular customer group for which you want to apply the permissions specified;
Category - contains the ‘Show’ or ‘Hide’ modes for you to choose;

Category Permissions | Customer Group Catalog Permissions for Magento 2

Product Price - contains the ‘Show’ or ‘Hide’ modes for you to choose;

Please note: if you decide to hide the product price, the Add to Cart button is hidden automatically. Instead, you can create a customized text message in the field ‘Text Message When Price is Hidden’ using a ready-made HTML-code.

Category Permissions | Customer Group Catalog Permissions for Magento 2

Add to Cart Button - contains the ‘Show’ or ‘Hide’ modes for you to choose.

Please note: if you decide to hide the Add to Cart button you can create a customized text message in the field ‘Text Message When Button Add to Cart Is Hidden’ using a ready-made HTML-code.

3. Product Permissions (individual settings)

Product Permissions | Customer Group Catalog Permissions for Magento 2

If you want to set the permissions for the individual product, you need to reach the New Permission grid. The fieldset  is available through the following path: Products  Categories Needed Product chosen from the Product grid  Edit Product Permissions by Aheadworks New Permission and includes the following columns:

Store View - the website which will be the application scope for the permissions specified;
Customer Group - the particular customer group for which you want to apply the permissions specified;
Product - contains the ‘Show’ or ‘Hide’ modes for you to choose;

Permissions | Customer Group Catalog Permissions for Magento 2

Product Price - contains the ‘Show’ or ‘Hide’ modes for you to choose;

Please note: if you decide to hide the product price, the Add to cart button is hidden automatically. Instead you can create a customized text message in the field ‘Text Message When Price is Hidden’ using a ready-made HTML-code.

Permissions | Customer Group Catalog Permissions for Magento 2

Add to Cart Button - contains the ‘Show’ or ‘Hide’ modes for you to choose.

Please note: if you decide to hide the Add to Cart button you can create a customized text message in the field ‘Text Message When Button Add to Cart Is Hidden’ using a ready-made HTML-code.

4. Static Page Permissions (individual settings)

Static Page Permissions (individual settings) | Customer Group Catalog Permissions for Magento 2

If you want to set the permissions for the individual CMS page, you need to reach the Static Page Permissions by Aheadworks fieldset. The grid is available through the following path: Content Pages  Needed Page chosen from the Page grid Select  Edit Static Page Permissions by Aheadworks > and includes the following columns:

Static Page - contains the ‘Show’ or ‘Hide’ modes for you to choose;
Store View - the website which will be the application scope for the permissions specified;
Customer Group - the particular customer group for which you want to apply the permissions specified. 

5. Update Permissions in Bulk

Update Permissions in Bulk | Customer Group Catalog Permissions for Magento 2

If you want to update permissions in bulk, you need to reach the Update Permissions in Bulk wizard. The wisard is available through the following path: Catalog > Update Permissions in Bulk and includes the following steps:
 
Select Catalog Element Type - the step to be made for you to choose between Categories, Products, and Pages;
Select Items - the step to be made for you to choose the items for which you want to set the permissions;
Set Permissions -  the step to be made for you to set the permissions for the items chosen.
 

Please note: the final step requires you to deal with the fieldset which is the similar to this one you see while configuring  individual permission settings for category, product of CMS page. Finally, to update the permissions in bulk you need to click on the button 'Apply' or the button 'Back' to change the previous steps.
Also, pay your attention that this functionality is available not only from the main menu, but also on the page of the individual permission settings for categories - the Category Permissions by Aheadworks page, products - the Product Permissions by Aheadworks page, and CMS page -  the CMS Page Permissions by Aheadworks page.

6. Delete Permissions in Bulk

Delete Permissions in Bulk | Customer Group Catalog Permissions for Magento 2

If you need to delete permissions in bulk you need to reach the Delete Permissions in Bulk wizard. The wizard is available through the following path: Catalog > Delete Permissions in Bulk and includes the following steps:

Select Catalog Element Type - the step to be made for you to choose between Categories, Products, and Pages;
Select Items - the step to be made for you to choose the items for which you want to set the permissions.

To delete the permissions you need to click on the button 'Delete' or the button 'Back' to change the previous steps.

Note that this functionality is available not only from the main menu, but also on the page of the individual permission settings for categories - the Category Permissions by Aheadworks page, products - the Product Permissions by Aheadworks page, and CMS page -  the CMS Page Permissions by Aheadworks page.

 
 
 
Customer Group Catalog Permissions | Customer Group Catalog Permissions for Magento 2

Write Your Own Review

Already used our product?

We would appreciate your feedback. Please, leave a review.

Only registered users can write reviews. Please Sign in or create an account
Report incorrect information

Still Have Questions?

Our customer care team is here for you!

Contact Us