Post by zebdev » Sat Nov 19, 2011 6:33 pm

Hi there,

I have a list of categories and then you click through to see all the products in that category. Then you click on a product!

How can I show the category name that product is in on the product page?

Thank you

New member

Posts

Joined
Tue Sep 13, 2011 3:43 am

Post by jimmyphong » Sat Nov 19, 2011 7:48 pm

Open file : catalog/controller/product/product.php

find code (may be in line 28) :

Code: Select all

$category_info = $this->model_catalog_category->getCategory($path_id);
add after :

Code: Select all

$this->data['category_name'] = $category_info['name'];
open product template file :

Code: Select all

catalog/view/theme/default/template/product/product.tpl
and the code any where you wanna show category name :

Code: Select all

<?php if(isset($category_name)) { ?>
		<?php echo $category_name; ?>
	<?php } ?>

News CMS || Plus SEO || Live Price change with Option Select


Active Member

Posts

Joined
Sat Aug 13, 2011 2:48 am


Post by zebdev » Sat Nov 19, 2011 9:43 pm

Excellent thank you - this works perfect.

New member

Posts

Joined
Tue Sep 13, 2011 3:43 am

Post by ozmofa » Fri Dec 23, 2011 6:37 am

it's not working 1.4.9 sorry why may not seeing in product detail?

Newbie

Posts

Joined
Tue Sep 29, 2009 4:54 pm
Who is online

Users browsing this forum: No registered users and 88 guests