| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
4.2 need different product template for just 1 category | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hello,
This is a hard one to search for again because so many things changed with 4.2... So I have 1 specific category that needs a different product.tpl because we are including videos and some images and stuff in the product description and will require vastly a different layout. What is the best way to go about this change? I realize I will use a smarty if, else statement in the product.tpl I think ... but I have no idea how to form the statement properly or where to put it... do I then just copy everything into both the if and the else and then slowly just change the if section until it does what I need?
__________________
X-Cart 4.5.4 Gold (Live Business Site) X-Cart 5.1.9 Business (In Development Now) |
|||||||
#2
|
|||||||||
|
|||||||||
![]() If 4.2 is the same as the 4.1 branch, in product.tpl, the variable $cat contains the categoryid of the current product, so you could do if-than statements based on the $cat variable.
You can test by temporarily putting this code in product.tpl and see if it gives you the data: Code:
If it works, you can use if/than/else statements based on the $cat variable to make the page. If you need differences for other category pages, you can try the solution posted here.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#3
|
|||||||||
|
|||||||||
![]() *****make a back up first*****
{if $cat eq 249} your new layout here {else} all other layouts here {/if} cahnge cat number with your cat number of course
__________________
xcart 5.1.2 |
|||||||||
#4
|
|||||||
|
|||||||
![]() Here are the first 10 lines of my product.tpl ... did I put this in the right spot? And this will be for category 1, I made it first and left it empty knowing I would have to fight this battle after I got the easy ones done....
Code:
EDIT: It worked! I set a margin vastly different in the first half of the code to test it, and it worked perfect ... did I put it in the right spot though? Or should it be before those javascript lines?
__________________
X-Cart 4.5.4 Gold (Live Business Site) X-Cart 5.1.9 Business (In Development Now) |
|||||||
#5
|
|||||||||
|
|||||||||
![]() its fine.
__________________
xcart 5.1.2 |
|||||||||
#6
|
|||||||
|
|||||||
![]() Thanks Ashley... can you recommend what to change in my product.tpl just for this category to get it to display thumnails of the "detailed images" under the main image so that a user can click them and it switches the image?
__________________
X-Cart 4.5.4 Gold (Live Business Site) X-Cart 5.1.9 Business (In Development Now) |
|||||||
#7
|
|||||||||
|
|||||||||
![]() will have to check that one out.
__________________
xcart 5.1.2 |
|||||||||
#8
|
|||||||
|
|||||||
![]() Well technically the title of this thread was about the category and you guys solved that, so I will make a new thread about my other question with some examples...
__________________
X-Cart 4.5.4 Gold (Live Business Site) X-Cart 5.1.9 Business (In Development Now) |
|||||||
#9
|
|||||||
|
|||||||
![]() Related question...
What is the smarty if statement for checking to see if there is a stock of 0 on an item? Is it {if $product.appearance.empty_stock} ??? Or is that just saying if you have your store set to show out of stock items? If so, what is the right one?
__________________
X-Cart 4.5.4 Gold (Live Business Site) X-Cart 5.1.9 Business (In Development Now) |
|||||||
#10
|
|||||||
|
|||||||
![]() {if $product.appearance.is_auction} right? Seems to work on my product.tpl page but I can't find the $lng.lbl_quanitity on my products_t.tpl page?? I need to remove that label if the stock is 0 from the category page...
__________________
X-Cart 4.5.4 Gold (Live Business Site) X-Cart 5.1.9 Business (In Development Now) |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|