Page 1 of 1

Customer Order Notifcation Email Template

Posted: Tue Jul 13, 2010 9:18 am
by SkylineTech
At the bottom of this email, I am trying to display the amount of the order that was paid for by Gift Certificate, the amount paid for by Credit Card, and the remaining balance of the Gift Certificate. Is this possible? If so, any sample code would be appreciated.

Thank you

Re: Customer Order Notifcation Email Template

Posted: Tue Jul 13, 2010 11:21 am
by mazhar
This could be something like

Code: Select all

#set($gcamount=0)
#foreach($payment in $order.Payments)
#if ( ($payment.PaymentMethodName == "Gift Certificate") && ($payment.PaymentStatus=="Captured") )
#set($gcamount =  $gcamount+ $payment.Amount.ToDecimal(null))
#end
#end
Gift Certificate Payments:$gcamount

Re: Customer Order Notifcation Email Template

Posted: Tue Jul 13, 2010 11:29 am
by SkylineTech
Thank you!

One more thing, is there a way to get the remaining Gift Certificate balance?

Thanks again!

Re: Customer Order Notifcation Email Template

Posted: Tue Jul 13, 2010 12:36 pm
by SkylineTech
Looks like I can do something like this:

Code: Select all

#set($gcID = 0)
#foreach($gcTrans in $order.GiftCertificateTransactions)
#if($gcTrans.GiftCertificateId != $gcID)
$gcTrans.GiftCertificate.SerialNumber&nbsp;&nbsp;-&nbsp;&nbsp;$gcTrans.GiftCertificate.Balance.ToString("C")<br />
#set($gcID = $gcTrans.GiftCertificateId)
#end
#end