Sr.Colas Posted April 5, 2011 Share Posted April 5, 2011 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 More sharing options...
dambie Posted July 10, 2011 Share Posted July 10, 2011 HiSolved the problem? Link to comment Share on other sites More sharing options...
vivek tripathi Posted July 12, 2011 Share Posted July 12, 2011 To show Subcategory Name on Product list page(subcategories) just open categorie.tpl and put {$return_category_name} where you want to show subcategory nameTo 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 More sharing options...
dambie Posted July 12, 2011 Share Posted July 12, 2011 Ok and how show subcategory name in homefeatured module ?? Link to comment Share on other sites More sharing options...
vivek tripathi Posted July 12, 2011 Share Posted July 12, 2011 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 More sharing options...
dambie Posted July 12, 2011 Share Posted July 12, 2011 Thanks, works And how add links to default category ? Link to comment Share on other sites More sharing options...
vivek tripathi Posted July 12, 2011 Share Posted July 12, 2011 Replace following line in module->homefeatured->homefeatured.tpl {$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'} with the following line categorie name --> {$product.category_default} Link to comment Share on other sites More sharing options...
dambie Posted July 12, 2011 Share Posted July 12, 2011 Ok but this code show name of default category I have put else link to default category Link to comment Share on other sites More sharing options...
vivek tripathi Posted July 12, 2011 Share Posted July 12, 2011 ok please clear me what exactly you want to show Link to comment Share on other sites More sharing options...
dambie Posted July 12, 2011 Share Posted July 12, 2011 {$product.category_default} in homefeatured Link to comment Share on other sites More sharing options...
vivek tripathi Posted July 12, 2011 Share Posted July 12, 2011 this code doesn't work at my machine {$product.category_default} at what location constant LINK TO DEFAULT CATEGORY value is defined Link to comment Share on other sites More sharing options...
dambie Posted July 12, 2011 Share Posted July 12, 2011 The {$product.category_default} smarty variable inserts the name of the default categories, which you insert into a template to show the correct link to the default category? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now