How to display product document field in INVOICE?

benyamin jain asked on December 22, 2014 10:56

HI How it is possible to disply a product document field in invoice?

example : Document Type : Computer Fields :


I want to display above fields inside invoice. how it is possible.

also i try ShoppingCart.ShoppingCartItems inside Order_ContentTable transformation as below

<td style="text-align: left">{%(IsProductOption) ? "&nbsp;&nbsp;-&nbsp;" : ""%}{%Localize(SKUName)%}
{%(CartItemText != "") ? (" '" + CartItemText + "'") : ""|(encode)%}
{% (ShoppingCart.IsDiscountApplied) ? ("<td>" + UnitTotalDiscount.Format("{0:F}") + "</td>") : "" #%}

but nothing happened(where is mistake?)

With Best Regards

Correct Answer

Zdeněk Cetkovský answered on December 22, 2014 15:35


Only common SKU properties are available immediately, as the SKUName, SKUDescription, etc. fields. You would need to create a macro method to lookup for all Pages/documents that have the NodeSKUID equal to the SKUID. In most cases this gives you single node, or you can achieve it by using .First macro selector over the collection of results or similar...

The ShoppingCart.ShoppingCartItems macro actually accesses the collection of shopping cart items, it doesn't render them in any way, unless you access a string (or other) property of one member of that collection or if you use ApplyTransformation over the collection to transform the objects into displayable markup. More on this topic can be found at Using transformations in macro expressions documentation article.

Moreover, besides ShoppingCart object, you could use Order object in the order invoice template...

Should you need any additional details, please feel free to ask.



1 votesVote for this answer Unmark Correct answer

Recent Answers

benyamin jain answered on December 24, 2014 11:49

HI Thanks for your reply. However the ability of accessing to none common SKU fields is good idea. writing custom macro solved my problem.

With Best wishes benyamin

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.