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
Customer Order Notifcation Email Template
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 22
- Joined: Tue Jul 13, 2010 9:12 am
Re: Customer Order Notifcation Email Template
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
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 22
- Joined: Tue Jul 13, 2010 9:12 am
Re: Customer Order Notifcation Email Template
Thank you!
One more thing, is there a way to get the remaining Gift Certificate balance?
Thanks again!
One more thing, is there a way to get the remaining Gift Certificate balance?
Thanks again!
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 22
- Joined: Tue Jul 13, 2010 9:12 am
Re: Customer Order Notifcation Email Template
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 - $gcTrans.GiftCertificate.Balance.ToString("C")<br />
#set($gcID = $gcTrans.GiftCertificateId)
#end
#end