![]() |
Apply seperate templates to products....
Hi Folks
I have some products are not really for sale - but require the surfer to email for more details. Is there a way where I can get these products to be displayed using a different template than the product.tpl? If so - which files would I need to be looking at? Cheers Tye |
The template that displays the product details is skin1/customer/main/product.tpl
If you amend the code by adding by a conditional around the add to cart/price part along the lines of: {if $smarty.section.products.index eq 16} email me for details {else} the normal price display bits {/if} where 16 is the product id that you want to show the email detail for. If this is more than one product then change it to: {if ($smarty.section.products.index eq 16) or ($smarty.section.products.index eq 19)} |
Hey funkydunk
Cheers for that - this smarty thing is very very good, I was expecting a long drawn out affair. I'm presuming that I can assign this variable to a full catagory, e.g. {if $smarty.section.catagory.index eq 16} email me for details {else} the normal price display bits {/if} If that is so - its getting even easier. Cheers |
even easier :!:
{if $cat eq "whatever it is!"} the smarty.section bit refers to a loop that the templates do signalled by {section}{/section} smarty is our friend :D |
Yup, we like smarty very much
thanks again |
How would this work if I have more than one catagory which needs update
e.g. Code:
if $cat eq "1"} Or can I do it like this:[code][code]if $cat eq "1", "2", "3"} email me for details {else} the normal price display bits {/if}[/code] |
In Answer to my own question
This is how it works with multiple categories {if $cat eq "1" or $cat eq "2" or $cat eq "3" or $cat eq "4"} email me for 1 details {else} email me for 2 details {/if} Hope this helps someone |
All times are GMT -8. The time now is 09:47 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.