Page 1 of 1

Force user to login first accessing any information page.

Posted: Thu Nov 16, 2017 11:38 pm
by mithunvijay
Hello,

I want to force user to login first accessing any information page.

Thanks in advance.
MD

Re: Force user to login first accessing any information page.

Posted: Fri Nov 17, 2017 12:51 am
by straightlight
You mean to force users to login before accessing the information page or force to login by forcing redirection to the information page? Please clarify your enquiry.

Re: Force user to login first accessing any information page.

Posted: Fri Nov 17, 2017 1:40 am
by mithunvijay
Hi Guru,

I want to user to be login before accessing the information page.

Regards,
MD

Re: Force user to login first accessing any information page.

Posted: Fri Nov 17, 2017 1:49 am
by straightlight
I would not suggest this approach in case of an opened case by a customer toward a payment provide regarding a complaint and more information about your Business would need to be obtained. With enforced restrictions, this could create political issues. However, in your catalog/controller/information/information.php file, you can find:

Code: Select all

$this->load->language('information/information');
add right above:

Code: Select all

if (!$this->customer->isLogged()) {
			$this->session->data['redirect'] = $this->url->link('account/account', '', true);

			$this->response->redirect($this->url->link('account/login', '', true));
		}
		
Again, not a suggested method to entirely restrict information pages if some of them describes the goal of your Business.

Re: Force user to login first accessing any information page.

Posted: Tue Nov 21, 2017 8:17 pm
by mithunvijay
Dear Gent,

Thanks for your reply and your code is working perfectly for my project.

Thanks again.

Regards,
MD