Try adding this at the top of controller / information / information.php right after declaring the index () function and replace {ID} with the page ID you want to password protect (you can get the ID from the URL or SEO URL from the admin section).
if (isset($this->request->get['information_id']) && $this->request->get['information_id'] == '{ID}') { //If the information_id is provided and it matches the ID you wish to protect if (!$this->customer->isLogged()) { //If the customer is not logged in already, redirect them to the login page //Use $this->session->data['redirect'] to redirect them back to this page after logging in $this->session->data['redirect'] = $this->url->link('information/information', 'information_id=' . $this->request->get['information_id']); //Do the redirect $this->redirect($this->url->link('account/login', '', 'SSL')); } }
I assumed that the info page is not used using SSL in the above example, you will need to change it if there is one.
If you are confused as to where this should go, take a look at controller / account / account.php - I took this code and changed it for specific information p.
source share