View Single Post
  #92  
Old 10-23-2008, 03:56 PM
 
Brian Schade Brian Schade is offline
 

Member
  
Join Date: Apr 2008
Posts: 25
 

Default Re: common if/then modifications I make to x-cart...

I need to format the invoices, both web-based and e-mail, to display information about how to pay via Check or Money Order (COMO). However, I only want this information to display if the person actually PAID by COMO. If the customer did not pay via COMO (in other words, paid by Gift Certificate, PayPal, or Credit Card) then the information specific to COMOs does not need to be shown or included in the e-mail.

I figured this would be a simple IF statement situation. But I'm not sure where to put the IF statement, or even on the syntax.

I have set up a new variable in my admin named eml_como. I figured the system would simply check the Payment Method variable and if it equalled "Check or Money Order" then it would simply display the eml_como value. I tried placing this IF statement in the signature.tpl file and using the $order.payment_method variable to check for the payment method. This appears to be the same variable that is used to display the payment method when generating the invoice to begin with. However, when I place the following code in my signature.tpl file;

Quote:
{if $order.payment_method == "Check or Money Order"}
{$lng.eml_como}
{/if}

I get no response at all.

I'm wondering if the problem lies in the fact that signature.tpl is a seperate template file than the template file that actually holds the value for that variable? The signature.tpl file, so far as I can tell, is called from two other templates; order_customer_processed.tpl and order_customer_complete.tpl. I'm guessing that this is the case. If this is true, where would be the best place to put the IF statement?

I really need to have this functionality built into our system. Any help would be greatly appreciated.
__________________
Brian Schade
Owner and CTO
Twilight Teez, LLC
www.twilightteez.com
X-Cart 4.1.9 GOLD
Reply With Quote