razzzila-dev / module-static-block-by-customer-group
N/A
Installs: 591
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 3
Open Issues: 1
Type:magento2-module
Requires
- magento/module-cms: >100.0
- magento/module-customer: >100.0
This package is not auto-updated.
Last update: 2025-03-11 10:51:07 UTC
README
Working with clients sometimes you want to add some privileges for some of them over other. Most simple example is to show the dedicated phone number of support for VIP customers. But it could be any content: images, text, even sliders, etc.
So here is the solution for this problem. Since mostly for displaying some content we use the static blocks, I just added new widget which have "Access Controll List" by Customer groups.
Works with FPC as well.
Installation
Package install
Manual installation
Download archive and unzip it.
Then move all files from module-static-block-by-customer-group
folder to the <magento_root>/app/code/Razzzila/StaticBlockACL
folder.
Using Composer
Change working directory to <magento_root>
and run:
composer require razzzila-dev/module-static-block-by-customer-group bin/magento module:enable Razzzila_StaticBlockACL bin/magento cache:flush
Usage
Let's create 2 blocks: one with default support number inside and another one with a dedicated phone number for VIP customers.
For doing so, in the admin panel open Content -> Blocks and click "Add new block" button. Fill fields and click "Save & Duplicate". Enable block, change Identifier, Block title, and Content (replace with a dedicated number) and click "Save".
Now navigate to Block or Page where you want to put a dynamic block (based on the customer group). In the content editor click on "Insert Widget" and choose "Static Block ACL". The first block will be default one, so choose the block with default phone number and choose groups for whom you want to show it (all except VIP group). The second one will be for VIP customers only. Right after the widget from above create another one but here choose the block with dedicated for VIP customers phone number and choose VIP customer group. Save the page/block.
To apply changes navigate to the Cache Management and Refresh the FPC(Full Page Cache).
Support
This module is not my priority, so in time support not guaranteed. But feel free to open new issues and create pull-requests if needed.