Post by lloydmedley » Tue Aug 05, 2014 11:14 pm

I need the price on just a few products to be hidden, only if the customer is not logged in.

Been trying to modify this mod: http://forum.opencart.com/viewtopic.php?f=112&t=4952

So far I have come up with

Code: Select all

if (!$logged) {
	$product_id = (int)$this->request->get['product_id'];
	if ($product_id == 449) {
		return 'TRADE ONLY';
	}
}
but that doesn't seem to check if they are logged in properly. Moved on to this:

Code: Select all

if (!$this->customer->isLogged()) {
	$product_id = (int)$this->request->get['product_id'];
	if ($product_id == 449) {
		return 'TRADE ONLY';
	}
}
But that gives me the error:

"Call to a member function on a non-object"

Can anyone help please?

If I forgot to mention: it's OpenCart Vv1.5.6


New member

Posts

Joined
Tue Mar 29, 2011 11:18 pm

Post by SXGuy » Wed Aug 06, 2014 4:59 am

I'll be honest, im not up to speed with recent changes to syntax, but a while back, im certain I remember it being $this->user->isLogged

I could be wrong, but try that anyway.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by lloydmedley » Wed Aug 06, 2014 4:32 pm

Just tried that and it seems to be working the same as if I use if (!$logged) { It's just saying TRADE ONLY whether they are logged in or not.

If I forgot to mention: it's OpenCart Vv1.5.6


New member

Posts

Joined
Tue Mar 29, 2011 11:18 pm
Who is online

Users browsing this forum: No registered users and 6 guests