are there some way to get the product's category name in jmproducts list in home page

Hi…

i woult like to show the category name of each product in the home list.
can u help me?

1 answer

Profile photo of thangnn1510 0.00 $tone January 26, 2011
Public

Dear cineamadoras!

Please add this code:

PHP Code:

<?php $product Mage::getModel("catalog/product")->load($_product->getId());                            

foreach(
$product->getCategoryIds() as $_catid){

$_category Mage::getModel('catalog/category')->load($_catid);

if(
$_category->getName() != "Root Catalog") echo "<p>".$_category->getName()."</p>";

}

?>


To about the line 26 of app\design\frontend\default\jm_galaxitetemplate\j oomlart\jmproducts\list.phtml (after </h5>).

Hope this helps and good luck!

#1

Please login or Register to Submit Answer

Written By

Comments