Jump to content

Product category in shopping-cart


Recommended Posts

Hi

I want to add in shopping-cart information about product category which was added to cart.

I found code to show this information in product-list.tpl

 

in product.php add:

 

$categories_ids = Product::getProductCategories($row['id_product']);
	$categories_names = array();
	foreach ($categories_ids AS $id) {
	$category = new Category($id);
	$categories_names[] = $id;
	}
	$row['categories'] = $categories_names;  

 

in product-list.tpl add:

{foreach from=$product.categories item=category name=category} {$category} <br/> {/foreach}

 

In product-list.tpl it is working but in shopping-cart-product.line.tpl not.

does anyone know how to do this? I appreciate your input!

Link to comment
Share on other sites

  • 1 year later...

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...