mediademon Posted October 20, 2008 Share Posted October 20, 2008 Hi Was just wondering if this is a useful addition to anyone's email templates? {if $invoice_payment_method=='Credit Card'} {if $client_cc_number==''}As you do not have a payment card assigned to your account, you will need to login and pay this invoice online now. {else}If your credit card details have changed then you will need to login and pay this invoice online now. Otherwise, payment will occur automatically on the {$invoice_date_due} from the following card: Card Type: {$client_cc_type} Card Number: {$client_cc_number} Expires: {$client_cc_expiry} {/if} {/if} First time i've used this conditional smarty stuff so i'm hoping this is the correct syntax? 0 Quote Link to comment Share on other sites More sharing options...
vanco.net Posted October 20, 2008 Share Posted October 20, 2008 That looks almost right, but my understanding is that your second "{if}" statement needs to be "{else if}" and you should remove one of the closing "{/if}'s at the end". Here's an example of code to refer to: http://forum.whmcs.com/showthread.php?p=62687 Cheers! 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted October 20, 2008 WHMCS CEO Share Posted October 20, 2008 Yes, that's correct syntax Matt 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted October 20, 2008 Author Share Posted October 20, 2008 Oops Matt - all confused now - vanco.net correct syntax or me? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted October 20, 2008 WHMCS CEO Share Posted October 20, 2008 No sorry, what you have written originally is correct. No changes needed. Matt 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted October 20, 2008 Author Share Posted October 20, 2008 Thanks Matt! And big thanks for a great system, I know have time to do other things for our business 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted October 22, 2008 Author Share Posted October 22, 2008 Just to let you know that the logical operator && breaks the smarty template... {if $invoice_payment_method == 'Pay Online' && $client_cc_number == ''} Using "and" works... {if $invoice_payment_method == 'Pay Online' and $client_cc_number == ''} Seems strange, && is part of the smarty syntax. 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted October 30, 2008 Author Share Posted October 30, 2008 Hi Ignore using $client_cc_number to check for the (non)existence of a card, use $client_cc_type instead. $client_cc_number contains "No existing card details on record" when empty! [color=#000000][color=#007700][font=verdana]{if $invoice_payment_method == 'Pay Online' and $client_cc_type == ''}[/font][/color][/color] 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.