View Single Post
  #2  
Old 05-19-2008, 01:44 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Put Category Name in products.tpl

Quote:
Originally Posted by matthewstroh
How would I call the product's category name in the products.tpl file? I'd like to have the title of the product just above a line that says the category name. Like this...

3 Button Red T-Shirt
From: JC Penny

Black Felt Fedora
From: Macy's

I don't know enough about how X-cart's individual pages make certain elements available for use. For example, on certain pages (like categories.tpl) you can use $c.category to display a category name, but that won't work here. Nor will $category, though $cat will display the number of the category, but that's not what I'm going for.

If you look at the current category, all products will have the same name category.

PHP Code:
.........
From: {$current_category.category}
........ 

But it will not work for blocks: "Featured products" and "Search".
For them, this problem is solved difficult. Will write later how to solve it, if you need it.
Reply With Quote