MTPockets Posted August 27, 2015 Share Posted August 27, 2015 I have version 1.5.4.1 and it is working fine but would like to know if it is possible to add a password protected page to the site for wholesale customers. If so, how would I go about doing it? Thanks Link to comment Share on other sites More sharing options...
Simone Salerno Posted August 27, 2015 Share Posted August 27, 2015 What page do you want to protect? Who should be able to visit that page? Only registered customers? Only customers from a group? It may be as simple as adding an .htpasswd to your root or overriding the controller responsible for that page. Link to comment Share on other sites More sharing options...
MTPockets Posted August 28, 2015 Author Share Posted August 28, 2015 I am planning on adding a page for wholesale only and do not want the general public access to wholesale pricing so this would be a page that only those with the password would be able to access the products and pricing. Link to comment Share on other sites More sharing options...
Simone Salerno Posted August 29, 2015 Share Posted August 29, 2015 You may need to override an existing controller / creating a new one with something like the following in it: //semi-pseudo code public function initContent() { parent::initContent(); if ($this->context->cookie->canViewPasswordProtectedPage) { //get the stuff you need //... $this->setTemplate('template-to-show.tpl'); } else { $this->setTemplate('template-of-login-form.tpl'); } } public function postProcess() { parent::postProcess(); if (Tools::isSubmit('checkPasswordProtectedPagePassword') && Tools::getValue('passwd') === YOUR_PASSWORD) { $this->context->cookie->canViewPasswordProtectedPage = true; $this->context->cookie->write(); } } I didn't tested but it's just an hint. This assumes you want to save the login in the cookie. Link to comment Share on other sites More sharing options...
vekia Posted August 30, 2015 Share Posted August 30, 2015 your wholesaler customers have own group? :-) Link to comment Share on other sites More sharing options...
ZedBike Posted September 28, 2015 Share Posted September 28, 2015 I'd like something similar like the topic starter, but my site run in catalog mode, so no registration at all. (Pretty ridiculous, that a complex script, like Prestashop doesn't have this feature...) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now