Post by graeme-77 » Fri Oct 11, 2013 2:44 am

Hi I hope somebody can help me on this, I keep getting an error in the logs:

>> PHP Notice: Undefined variable: product_total in /home/sites/'site'/public_html/catalog/controller/common/header.php on line 88<<

The header source is this:
$children_data[] = array(
'name' => $child['name'] . ' (' . $product_total . ')',
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
);
}

line 88 is this:>> 'name' => $child['name'] . ' (' . $product_total . ')',

I am on Version 1.5.2.1

If anybody has any idea I would really appreciate it
Thanks Graeme

Newbie

Posts

Joined
Tue Aug 02, 2011 6:22 pm

Post by ChetanCx » Fri Oct 11, 2013 2:53 am

check if this line exist around line no 85

Code: Select all

$product_total = $this->model_catalog_product->getTotalProducts($data);
if not add add it

User avatar
Active Member

Posts

Joined
Sat Dec 08, 2012 8:12 pm

Post by graeme-77 » Fri Oct 11, 2013 3:01 am

Hi ChetanCX

I have this exactly on line 85:

//$product_total = $this->model_catalog_product->getTotalProducts($data);

But I have looked at a newer version and line 88 looks like this:

'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),

however mine is:

'name' => $child['name'] . ' (' . $product_total . ')',


Thanks Graeme

Newbie

Posts

Joined
Tue Aug 02, 2011 6:22 pm

Post by graeme-77 » Fri Oct 11, 2013 3:31 am

Ok ChetanCX I think you have solved it, it looks like that line 85 has double slashes but dont know why so I will test it for a few hours without the the slashes

Graeme

Newbie

Posts

Joined
Tue Aug 02, 2011 6:22 pm

Post by ChetanCx » Fri Oct 11, 2013 4:30 pm

double slashes in php (and many other languages) means the following line is a comment and is not executed, remove the slashes and it should work fine

User avatar
Active Member

Posts

Joined
Sat Dec 08, 2012 8:12 pm
Who is online

Users browsing this forum: No registered users and 82 guests