Jump to content

Subcategory name on Product list


Recommended Posts

Hello buddys, i'm looking for a custom code to get the current sub category in the product page, i get the category name with this code but i wonder how i can get the sub-category


$categor = New Category((int)($product->id_category_default));
$categor = $categor->name;





Regards

Link to comment
Share on other sites

  • 3 months later...

To show Subcategory Name on Product list page(subcategories) just open categorie.tpl
and put

{$return_category_name}


where you want to show subcategory name


To show Subcategory Name on Product page just open product.tpl
and put

{$return_category_name}


where you want to show subcategory name

Link to comment
Share on other sites

To show subcategory name in homefeatured module

Replace following line of module->homefeatured->homefeatured.tpl

{$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}



with the code

{$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}
categorie name-> {$product.category_default}




you have to add {$product.category_default} in foreach loop under li

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...