| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Put Category Name in products.tpl | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() 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.
__________________
Matthew Stroh Version 4.1.9 |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() Quote:
If you look at the current category, all products will have the same name category. PHP Code:
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. |
|||||||||
#3
|
|||||||||
|
|||||||||
![]() How is it possible that the block knows to display so much information about the product except which category it belongs to? If you have the solution to this, I'd gladly appreciate it because you're right, it only displays on the product's current category page which makes them all display the same name.
Also, the place where this is most important is the homepage: but, like you said, it doesn't work in blocks so nothing appears on the featured product block on the home page. Any ideas? I'd gladly appreciate some help with this.
__________________
Matthew Stroh Version 4.1.9 |
|||||||||
#4
|
|||||||
|
|||||||
![]() Was this ever solved? This is something I am interested in also.
__________________
X-Cart Gold 4.3.1 Military Support Shop :: Army Wife Clothing, Military Support T-Shirts |
|||||||
#5
|
|||||||||
|
|||||||||
![]() No, it has yet to be solved.
__________________
Matthew Stroh Version 4.1.9 |
|||||||||
#6
|
|||||||
|
|||||||
![]() I am also interested in the solution of this issue...
__________________
x-cart 4.1.10 gold |
|||||||
#7
|
|||||||||
|
|||||||||
![]() Try this (tested on 4.2):
Open include/search.php. FIND: Code:
AFTER ADD: Code:
Open 4.1: skin1/customer/main/products.tpl and/or skin1/customer/main/products_t.tpl 4.2: skin1/customer/main/products_list.tpl and/or skin1/customer/main/products_t.tpl FIND (this will differ slightly on 4.1.x as it will specify a product.php url with a different class. Basically put the new code where you want the category to be displayed.): Code:
Code:
Also make sure the 'lbl_category' language variable exists. |
|||||||||
#8
|
|||||||||
|
|||||||||
![]() Hi,
I was just looking for similar code. It works except I need to display the MAIN category specified for individual product. I'm not a MySQL expert... ![]() category.main eq "Y" and display the product's main category. Thank you in advance ![]() I'm working with xcart 4.2.
__________________
__________________ XC5: 5.3.4.4 PHP: 7.0.26 MySQL server: 5.5.56-MariaDB |
|||||||||
|
|||
X-Cart forums © 2001-2020
|