Showing posts with label How to get the category title on the product details page Opencart. Show all posts
Showing posts with label How to get the category title on the product details page Opencart. Show all posts

Thursday, 6 November 2014

Display category name on product page Opencart


Display category name on product page Opencart

Put below code in your product.tpl file

<?php
$category = $this->model_catalog_product->getCategories($product_id);
if ($category){
  $category_array = $this->model_catalog_category->getCategory($category[0]['category_id']);
  echo $category_array['name'];
}
?>