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

If Statement for Invoices

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-18-2009, 11:54 AM
 
jherzog jherzog is offline
 

Advanced Member
  
Join Date: Jan 2006
Posts: 93
 

Default If Statement for Invoices

I have made a modification (addition) to currency.tpl. This is the template file that controls how prices are displayed. I only want that change to show up when you viewing products or a product. I do not want this change to show up on the invoices (emails).

My idea was to wrap my modification in an if statement that checks to see if this file is being called to create an invoice. i.e. {if $invoice eq true}. Is there any such variable that identifies this is an invoice not a product listing (or visa versa)?

Thanks
__________________
Jed Herzog
Gold X-Cart 4.0.17
http://www.outliersolutions.com
Portland Advertising Agency,
Portland Web Design
Reply With Quote
  #2  
Old 03-18-2009, 12:32 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: If Statement for Invoices

Quote:
I only want that change to show up when you viewing products or a product. I do not want this change to show up on the invoices (emails).

so the best way to do this is to ask IF it's a product or catalog. try this:

{if $main eq "product"}
show the currency.tpl edit
{/if}

{if $main eq "catalog"}
show the currency.tpl edit
{/if}

or use an else in there....

Helpful?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #3  
Old 03-18-2009, 01:27 PM
 
jherzog jherzog is offline
 

Advanced Member
  
Join Date: Jan 2006
Posts: 93
 

Default Re: If Statement for Invoices

Thats great, I was so close I had the {if $main eq "product"} but did not know how to identify if it was a product list. If {if $main eq "catalog"} does that then this is exactly what I needed.

I ended up moving the mod out of currency.tpl and into customer/main/product.tpl and customer/main/products.tpl. That works. Sucks the mod is in two places but it got the job done and I can't afford to go back and try this suggestion.

I really appreciate your help and suggestion.

Thanks,
Jed
__________________
Jed Herzog
Gold X-Cart 4.0.17
http://www.outliersolutions.com
Portland Advertising Agency,
Portland Web Design
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 09:31 PM.

   

 
X-Cart forums © 2001-2020