Showing posts with label Display the product's category on the product page in Opencart. Show all posts
Showing posts with label Display the product's category on the product page in 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'];
}
?>