Post by mythri » Thu Mar 10, 2016 8:04 pm

I want to display an information page on certain conditions like 1. Customer Group ID is 2 2. Customer is logged in

If these two conditions meets then, display information page(id-12) Course1.

I am trying to do it in catalog/controller/information.php

$id = $this->customer->getGroupId();
if ((!$this->customer->isLogged()) && ($information_id == 12) && ($id==2)) {
$this->response->redirect($this->url->link('account/account', '', 'SSL'));

}

But without login also this page is visible :(.

New member

Posts

Joined
Thu Apr 25, 2013 2:28 pm

Post by ocart777 » Thu Mar 10, 2016 8:20 pm

mythri wrote:I want to display an information page on certain conditions like 1. Customer Group ID is 2 2. Customer is logged in

If these two conditions meets then, display information page(id-12) Course1.

I am trying to do it in catalog/controller/information.php

$id = $this->customer->getGroupId();
if ((!$this->customer->isLogged()) && ($information_id == 12) && ($id==2)) {
$this->response->redirect($this->url->link('account/account', '', 'SSL'));

}

But without login also this page is visible :(.
if the customer group id is 2 then show the page else will redirect to account

Code: Select all

$group_id = $this->customer->isLogged() ? $this->customer->getGroupId() : 0;
if ($information_id == 12 && $group_id != 2) {
    $this->response->redirect($this->url->link('account/account', '', 'SSL'));
}

You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.


OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE


User avatar
Active Member

Posts

Joined
Mon Jun 10, 2013 4:57 pm
Location - Malaysia

Post by mythri » Thu Mar 10, 2016 9:55 pm

Thanks

But it is not working. I have put the code in catalog/controller/information/information.php

Without login also this page is visible.

:(

New member

Posts

Joined
Thu Apr 25, 2013 2:28 pm

Post by mythri » Thu Mar 10, 2016 10:16 pm

Oooops! Sorry!

It is working fine. I had to clear the cache in my browser.
Thank you very much.

New member

Posts

Joined
Thu Apr 25, 2013 2:28 pm
Who is online

Users browsing this forum: No registered users and 12 guests