| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Tabular Format products.tpl | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I have made a copy of products.tpl, stripped out a lot of surplus (for my needs) code and reformatted it into a tabular display.
This template (products_tab.tpl) is called from subcategories.tpl replacing the existing call to products.tpl and works fine. It is particularly effective for cats with a significant number of items for sale. My question is this - There are some of my categories that don't hold a vast number of products, where the original products.tpl would be more effective. Is there a smart way of calling the standard or revised templates depending on which cat is selected? The cat IDs in question are completely random, for example cats 6, 19, 20 and 22 are where I would like the standard template to be called, the rest calling the tabular version. What would be the syntax for an {if}{else} hard-coded statement? Thanks in anticipation, FN.
__________________
www.smartchoicemusic.com Smart Choice Music - Import CD and DVD Specialists 4.6.0 MySQL 5.5.34 PHP 5.4.24 Apache/2.2.26 Multiple homegrown and paid-for mods |
|||||||
#2
|
|||||||
|
|||||||
![]()
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
![]() Excellent!
I've seen that post on my travels around the forum, but didn't get the significance of it. {if $product.categoryid == 4 or $product.categoryid == 5}{/if} is the snippet that works for subcategories.tpl Note to oneself: Pay more attention in future and don't bug forumistas for answers that have already been posted! Many thanks, FN
__________________
www.smartchoicemusic.com Smart Choice Music - Import CD and DVD Specialists 4.6.0 MySQL 5.5.34 PHP 5.4.24 Apache/2.2.26 Multiple homegrown and paid-for mods |
|||||||
#4
|
|||||||
|
|||||||
![]() Don't worry about it, the search function on the forum sucks so it isn't always easy to find stuff
![]()
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||
|
|||||||
![]() Fearnothing ...the mod you made to the product display is exactly what I have been looking for. Can you post the code ?
Thanks
__________________
X-cart Gold - 4.08 |
|||||||
#6
|
|||||||
|
|||||||
![]() Okay - here goes if anyone can use it.
This is the code for my products_tab.tpl template The cycle command just alternates between a white and colored background to each row to make it easier to read. There's an if/then in there that either displays the product thumbnail or a link to an audio sample depending on whether the extra field is empty. If empty it means on my system that this is a full CD so we just want the thumbnail, or if it has an entry it is a single track mp3 download so we want the preview clip link. I think I've already credited elsewhere the thread on the forum that helped me display the extra field. I seem to remember different elements in the original products.tpl caused the extra fields to not display so this is very much stripped down to the bare essentials that I need for my store. Sorry it isn't better commented .......... Code:
__________________
www.smartchoicemusic.com Smart Choice Music - Import CD and DVD Specialists 4.6.0 MySQL 5.5.34 PHP 5.4.24 Apache/2.2.26 Multiple homegrown and paid-for mods |
|||||||
#7
|
|||||||
|
|||||||
![]() Thank you very much .... It has really helped a great deal
Chris
__________________
X-cart Gold - 4.08 |
|||||||
|
|||
X-Cart forums © 2001-2020
|