Zen Cart custom software development, Zen Cart modules, Zen Cart Expert eCommerce with Zen Cart!


Please note: This is old content; I have not worked on Prestashop since 2009.

CMS Restrictions by Group for PrestaShop

A PrestaShop mod which allows you to hide specific pages by customer group. You may also hide pages from users who are not logged in.

This mod builds on the excellent work started by Aaron @ Geocachestore in this thread.

Relevance: PrestaShop 1.2.4 and forward

Cost: Free

Download: download link

Installation Instructions: click here

FAQ: click here

Current Version: 1.2

Support Thread: PrestaShop CMS Group Restrictions Support Thread


Overview:

A mod which permits you to selectively hide CMS pages based on customer group.

Here's how it works:

  1. PrestaShop has a built-in "groups" functionality for adding discounts. All users are in the default group, which has a discount of 0%, and additional groups can be created with specific percentage discounts. The Group Creation screen is in Admin > Customers > Groups, and the Group Assignment area is in Admin > Customers when you edit a specific customer.
    Groups in PrestaShop


  2. In the page Admin > Tools > CMS, at the bottom of the page, a series of checkboxes is provided, which correspond to the groups above. One additional group called "Guest" is created, which corresponds to users who are not logged in. Check the box for groups you want the page hidden from. In the example shown, the page would be hidden from people who are not logged in or not in the "Wholesalers" group. (Note: the "Default" box is not checked since this would block all logged in users.)
    Prestashop Group Restriction Settings


    The page is now hidden from users who are not in the Wholesalers group in the Info Block, the SiteMap, footer links or any other area where CMS pages are referenced.


Installation Instructions:

NOTE: If you installed version 1.1 of this contribution, you should restore the file ./modules/blockinfos/blockinfos.php from a fresh copy.
  1. Back up everything! Try this in a test environment prior to installing it on a live shop.
  2. Run the command "cms.sql" against your database in phpMyAdmin. If you have used a prefix other than "ps_" for your tables, modify this file accordingly (e.g. if config/settings.inc.php has '_DB_PREFIX_' set to 'ps1_', change `ps_cms` to `ps1_cms` in cms.sql.)
  3. Restrict page views as desired in Admin > Tools > CMS.

Installation Issues:

If it isn't working, please check the following:
  1. If pages you thought should not be hidden are being hidden, be sure they are checked in the block where they should be appearing. For example, if you create a new page in Admin > Tools > CMS, it will not show up in the Info Block by default. You must enable it in Admin > Modules > Blocks > Info Block > Configure.
  2. If you installed version 1.1 of the original version of this contribution, did you restore the file ./modules/blockinfos/blockinfos.php from a fresh copy?
  3. Be careful about filtering out the "Default" group, since all logged in users are part of the default group. The only setting that really makes sense if Default is checked is for Guest to be unchecked; this means "only show to not logged in users."

FAQ

Q: Why does this utility not use the PrestaShop translation tool?
A: Because the way strings are stored and used is different, and it would have been more confusing to do it the standard PrestaShop way.

Q: Can this mod be used in conjunction with your BoilerPlate in Product Descriptions for PrestaShop mod?
A: Yes. You just have to merge the file "./classes/CMS.php" in the two mods.