Email template nvelocity variable

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
michael.p.larsen
Lieutenant (LT)
Lieutenant (LT)
Posts: 70
Joined: Fri Jan 15, 2010 8:17 am

Email template nvelocity variable

Post by michael.p.larsen » Thu Feb 11, 2010 4:48 pm

I'm trying to sum line items amounts, but for some reason the decimal isn't getting included.
I'm doing:

#set ($shipTotal = 0)
...
#set ($shipTotal = $shipTotal + $orderItem.Price)


Say the Price is 100.25... the $shipTotal would only show 100.

What am I doing wrong?

michael.p.larsen
Lieutenant (LT)
Lieutenant (LT)
Posts: 70
Joined: Fri Jan 15, 2010 8:17 am

Re: Email template nvelocity variable

Post by michael.p.larsen » Thu Feb 11, 2010 5:15 pm

Got it.
Have to use .ToDecimal

#set ($shipTotal = $shipTotal.ToDecimal(null) + ($orderItem.Price.ToDecimal(null) * $orderItem.Quantity))

ozlighting
Lieutenant (LT)
Lieutenant (LT)
Posts: 53
Joined: Tue Mar 24, 2009 9:49 pm
Contact:

Re: Email template nvelocity variable

Post by ozlighting » Tue Aug 10, 2010 7:07 am

Thanks for posting the solution, you helped me out!

Cheers,

Lance
Australian Online Lighting Store

log on and light up...

Post Reply