X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Apply seperate templates to products.... (https://forum.x-cart.com/showthread.php?t=1824)

Tye 03-10-2003 09:18 AM

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

funkydunk 03-10-2003 09:37 AM

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)}

Tye 03-10-2003 09:45 AM

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

funkydunk 03-10-2003 09:48 AM

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

Tye 03-10-2003 09:49 AM

Yup, we like smarty very much

thanks again

Tye 03-26-2003 08:59 AM

How would this work if I have more than one catagory which needs update

e.g.

Code:

if $cat eq "1"}
email me for details
{else}
{if $cat eq "2"}
email me for details
{else}
{if $cat eq "3"}
email me for details
{else}
{if $cat eq "4"}
email me for details
{else}
the normal price display bits
{/if}
{/if}
{/if}
{/if}


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]

Tye 08-24-2003 07:19 PM

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.