NVelocity commands for order items
NVelocity commands for order items
Hey I'm trying to add the order item CostofGoods and an Extended CostofGoods to an email template for a client. Does anyone have any idea what nVelocity script commands I need to use?
$orderItem.CostofGoods doesn't seem work. Plus, I don't know how to do math - it looks like I could do {$orderItem.CostofGoods * $orderItem.Quantity} but that no workie.
Thoughts?
$orderItem.CostofGoods doesn't seem work. Plus, I don't know how to do math - it looks like I could do {$orderItem.CostofGoods * $orderItem.Quantity} but that no workie.
Thoughts?
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
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: NVelocity commands for order items
Maybe that is defined in the variables that Able uses for nVelocity and you need to define a new variable?
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: NVelocity commands for order items
I don't understand - what Able variables?
I thought all the nVelocity variables started with a $ or something. I really don't know, haven't worked much with them and I don't know of any documentation beyond what we had 7 months ago.
I thought all the nVelocity variables started with a $ or something. I really don't know, haven't worked much with them and I don't know of any documentation beyond what we had 7 months ago.
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
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: NVelocity commands for order items
I thought I had read in the first help docs that came out with Able that you could define variables if you needed additional ones. Maybe I imagined it. I've done some searching on nVelocity lately and I can't even find out if there is an "or". Documentation is pretty scarce or I don't know what to Google on.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: NVelocity commands for order items
Yeah the best I could find was a basic standard, but nothing about what Able has implemented specific to the Able data classes. That's what I need - there's gotta be a way, I just don't know the syntax.
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: NVelocity commands for order items
You can find more about the NVelocity and customizing the pages at:Available Variables
The variables that are available to you depend on the page being viewed. You will always have access to the “Store” and “User” variables. If the scriptlet is part of a page that is viewing a category, you will also have access to the “Category” variable. The same applies to “Product”, “Webpage”, and “Link”.
A sample of the more commonly accessed properties is given below.
$Store.Name
$Store.StoreUrl
$User.IsAnonymous
$User.Name
$User.PrimaryAddress.FirstName
$User.PrimaryAddress.LastName
$Product.Name
$Product.Price
$Product.Weight
$Category.Name
These “variables” are actually the CommerceBuilder objects being used by the ASP.NET scripts. You can access any property of these objects through nVelocity. View the CommerceBuilder developer reference for properties beyond those described above.
http://help.ablecommerce.com/mergedProj ... _pages.htm
You can not access an order item directly but by using the $Order variable and looping through it Order Items. something like:
Code: Select all
#foreach($i in $Order.OrderItems)
code to process the order item
#end
Thanks for your support
Naveed Ashraf
.com
AbleCommerce Help Center
AbleCommerce Developer WIKI
Follow us on Twitter
Naveed Ashraf

AbleCommerce Help Center
AbleCommerce Developer WIKI
Follow us on Twitter
Re: NVelocity commands for order items
For nVelocity syntax reference:
http://help.ablecommerce.com/mergedProj ... erence.htm
http://help.ablecommerce.com/mergedProj ... erence.htm
Thanks for your support
Naveed Ashraf
.com
AbleCommerce Help Center
AbleCommerce Developer WIKI
Follow us on Twitter
Naveed Ashraf

AbleCommerce Help Center
AbleCommerce Developer WIKI
Follow us on Twitter
Re: NVelocity commands for order items
Thank you for the information. However this does not appear accurate.Naveed wrote:You can not access an order item directly but by using the $Order variable and looping through it Order Items. something like:
Code: Select all
#foreach($i in $Order.OrderItems) code to process the order item #end
For example, the Vendor Notification Email Template does not use a #foreach to loop through the various order items. $Order.OrderItem is embedded within a table HTML tag and no looping commands are present. Yet the template appears to render multiple line items.
As a programmer, I am aware of the various data classes and their actual names. However non-programmers would not have this knowledge nor would they have the skills to tie the API help file class names to the nVelocity equivalents. A complete and plain-english nVelocity reference would be very helpful to everyone.
AC7 is final now - the days of trial-and-error to learn the specifics should be over.
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: NVelocity commands for order items
Please check again the Vendor Notification Email template, it is using the foreach loop to loop the order items:SolunarServices wrote:Thank you for the information. However this does not appear accurate.Naveed wrote:You can not access an order item directly but by using the $Order variable and looping through it Order Items. something like:
Code: Select all
#foreach($i in $Order.OrderItems) code to process the order item #end
For example, the Vendor Notification Email Template does not use a #foreach to loop through the various order items. $Order.OrderItem is embedded within a table HTML tag and no looping commands are present. Yet the template appears to render multiple line items.
It is using the following statement:
#foreach( $orderItem in $order.Items )
You can access the orderItems collection contained by the order using $Order.Items, Sorry for my previous post in which I mentioned as $Order.OrderItems which is not correct, but that was only for example.
Thanks for your support
Naveed Ashraf
.com
AbleCommerce Help Center
AbleCommerce Developer WIKI
Follow us on Twitter
Naveed Ashraf

AbleCommerce Help Center
AbleCommerce Developer WIKI
Follow us on Twitter
Re: NVelocity commands for order items
Aha! This was a correction made between RC3 and final. My main site is still running RC3
In looking at my 2nd site running AC7 final, the template shows the loop command correctly. I'll do my testing there and see what I can come up, thanks for the info.

In looking at my 2nd site running AC7 final, the template shows the loop command correctly. I'll do my testing there and see what I can come up, thanks for the info.
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