Jump to content

Product categories and subcategories


Recommended Posts

Hello,
On product page I want to display all categories and subcategories to which the product is assigned. Something like this:
-Category 1
--Sub1
--Sub2
-Category 2
--Sub3
--Sub4

My current code is:
 

					{foreach from=$product_categories item=product_category}
						{if $product_category.id_category != 2}
							<li >
								<a href="{$link->getCategoryLink($product_category.id_category, $product_category.link_rewrite)}"
								title="{$product_category.name}">{$product_category.name}</a>
							</li>	
						{/if}
					{/foreach}

But its print all categories in every line without category tree.

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More