Hello,
We're trying to customize our order confirmation email to display payments made and I'm trying to figure out how to get it to display gift certificates used to pay and the total. The default version includes the total without taking into account gift certificates.
How would this be incorporated? Is there a $order.Items.TotalPriceById that corresponds to Gift Certificates? Also Why doesn't $order.Items.TotalPriceById() incorporate the price post gift certificate? Is there a place to find the breakdown of what $order.Items.TotalPriceById has in the array?
Thank you.
Email "Receipt" help
Re: Email "Receipt" help
Gift certs are considered payments, so you would find them in $order.Payments
Since multiple payments are permitted per order, you'll have to do a for-each loop to work through the payments container.
TotalPricebyId is just a subroutine that totals up line items in the order by the OrderItemTypeId value. So .TotalPricebyId(3) would return the total for all line items with an OrderItemTypeId of 3. That way you can combine line items of a given type into single dollar amount.
To get it to do the math the way you want, you'll have to do the mathematics manually with nVelocity variables.
nVelocity isn't the easiest to read and the email templates can be a pain to modify
Since multiple payments are permitted per order, you'll have to do a for-each loop to work through the payments container.
TotalPricebyId is just a subroutine that totals up line items in the order by the OrderItemTypeId value. So .TotalPricebyId(3) would return the total for all line items with an OrderItemTypeId of 3. That way you can combine line items of a given type into single dollar amount.
To get it to do the math the way you want, you'll have to do the mathematics manually with nVelocity variables.
nVelocity isn't the easiest to read and the email templates can be a pain to modify

Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
Re: Email "Receipt" help
I'm sorry this has taken me so long, but currently the loop that is in the emails is:
#foreach ( $payment in $payments )
$payment.PaymentMethodName
$payment.ReferenceNumber
#end
Now, this does show multiple types of payments, but NOT gift certificates. How would I edit this to get those in there? would I have to add a foreach along the lines of:
#foreach ( $payment in $order.Payments )
$payment.PaymentMethodName
$payment.ReferenceNumber
#end
If so, how well would this work in conjunction with the first loop? Also, I have no problem doing "manual" mathematics, but I would need to know a variable in order to reference it in response to do subtraction.
Also, most of them have their own id, such as subtotal is .TotalPriceById(0) and shipping and handling is .TotalPriceById(1, 2), is there no simular id for gift certificates? This seems very odd to me.
Thank you again.
#foreach ( $payment in $payments )
$payment.PaymentMethodName
$payment.ReferenceNumber
#end
Now, this does show multiple types of payments, but NOT gift certificates. How would I edit this to get those in there? would I have to add a foreach along the lines of:
#foreach ( $payment in $order.Payments )
$payment.PaymentMethodName
$payment.ReferenceNumber
#end
If so, how well would this work in conjunction with the first loop? Also, I have no problem doing "manual" mathematics, but I would need to know a variable in order to reference it in response to do subtraction.
Also, most of them have their own id, such as subtotal is .TotalPriceById(0) and shipping and handling is .TotalPriceById(1, 2), is there no simular id for gift certificates? This seems very odd to me.
Thank you again.