1

I need to configure shop where only registered customers can buy and I'm using Magento EE option "Website restrictions". I have landing page, registration page and login page where customers can access but I need one more CMS page (Terms and Conditions) where non registered users can access.

Is there some solution for this? Some code where I can say if this is terms page skip restriction, or something like that...

My last option is to create custom, non magento page for this. Light box isn't option too :(

Hope that question is clear enough, screenshot is attached too.

Thanks in advance.

Magento EE - Website Restriction

1 Answer 1

3

Well, my answer will probably not make you fully happy. But at least you can use a CMS page after this change. It will take up much more changes to be able to only enable a single CMS page.

The WebsiteRestriction module uses the full action name of a page to determine whether the visitor is allowed to view the page. The logic to determine this can be found in Enterprise_WebsiteRestriction/Model/Observer.php in the method restrictWebsite. Since the full action name contains the module, controller and action name there is no difference between the CMS pages. All pages react to the full action cms_page_view.

By default CMS pages, as you noticed, are not visisble when running in restriction mode. You can change this by adding the cms_page_view node to the the following XML xpath frontend/enterprise/websiterestriction/full_action_names/generic. This will add all CMS pages to the whitelist and make them viewable when not logged in.

The default list of available actions can be found in Enterprise_WebsiteRestriction/etc/config.xml. I do firmly suggest that you create your own module to add your additional nodes to the XML instead of making changes to the config.xml of the restriction module.

Hopefully this will help you a bit in the right direction.

If you really want to only make a few CMS pages available then you should extend the the functionality of restrictWebsite in Enterprise_WebsiteRestriction/Model/Observer.php and add logic that matches on, for example, CMS page IDs which can be found in the request object. For this however you need some additional Magento experience, but perhaps you already got sufficient Magento time under your belt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.