I have been trying to display my category description into the product listing page but can't crack it still.
I tried following codes and add it into my product-list.tpl;
($default_category->description)
AND
($product.default_category->description)
I understand that I need to modify the Product.php class function but I am not sure which one. Can anyone guide me on this?
I had tried to modify getProductsProperties class by adding
$results_array = array();
$categories_ids = Product::getProductCategories($row['id_product']);
$categories_names = array();
foreach ($categories_ids AS $id) {
$category = new Category($id);
$categories_names[] = $category->getName();
}
$row['categories'] = $categories_names;
then add following codes to product-list.tpl but it didn't show anything.
<!-- Display categories -->
<span id="product_categories">
{foreach from=$product.categories item=category name=category}
{$category} <br/>
{/foreach}
</span>
please use this code to display current category