Post by mithunvijay » Thu Nov 16, 2017 11:38 pm

Hello,

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

Thanks in advance.
MD

Newbie

Posts

Joined
Fri Jan 07, 2011 2:47 am

Post by straightlight » Fri Nov 17, 2017 12:51 am

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by mithunvijay » Fri Nov 17, 2017 1:40 am

Hi Guru,

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

Regards,
MD

Newbie

Posts

Joined
Fri Jan 07, 2011 2:47 am

Post by straightlight » Fri Nov 17, 2017 1:49 am

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by mithunvijay » Tue Nov 21, 2017 8:17 pm

Dear Gent,

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

Thanks again.

Regards,
MD

Newbie

Posts

Joined
Fri Jan 07, 2011 2:47 am
Who is online

Users browsing this forum: No registered users and 17 guests