Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Apply seperate templates to products....

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-10-2003, 09:18 AM
 
Tye Tye is offline
 

eXpert
  
Join Date: Nov 2002
Location: Australia
Posts: 284
 

Default 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
__________________
Today is a beautiful day, grab it while you can and live it to the full

Version 4.2.3 UNIX
Reply With Quote
  #2  
Old 03-10-2003, 09:37 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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)}
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 03-10-2003, 09:45 AM
 
Tye Tye is offline
 

eXpert
  
Join Date: Nov 2002
Location: Australia
Posts: 284
 

Default

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
__________________
Today is a beautiful day, grab it while you can and live it to the full

Version 4.2.3 UNIX
Reply With Quote
  #4  
Old 03-10-2003, 09:48 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 03-10-2003, 09:49 AM
 
Tye Tye is offline
 

eXpert
  
Join Date: Nov 2002
Location: Australia
Posts: 284
 

Default

Yup, we like smarty very much

thanks again
__________________
Today is a beautiful day, grab it while you can and live it to the full

Version 4.2.3 UNIX
Reply With Quote
  #6  
Old 03-26-2003, 08:59 AM
 
Tye Tye is offline
 

eXpert
  
Join Date: Nov 2002
Location: Australia
Posts: 284
 

Default

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]
__________________
Today is a beautiful day, grab it while you can and live it to the full

Version 4.2.3 UNIX
Reply With Quote
  #7  
Old 08-24-2003, 07:19 PM
 
Tye Tye is offline
 

eXpert
  
Join Date: Nov 2002
Location: Australia
Posts: 284
 

Default

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
__________________
Today is a beautiful day, grab it while you can and live it to the full

Version 4.2.3 UNIX
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:56 PM.

   

 
X-Cart forums © 2001-2020