Hi,
unfortunately, the Tax values are not stored within OrderItem(Info), so you cannot get the value directly from it.
You could first obtain the
ShoppingCart object based on the Order, using
ShoppingCartInfoProvider.
GetShoppingCartInfoFromOrder(int orderId)
then you could get the tax of each ShoppingCartItem using properties
UnitTotalTax or
UnitTotalTaxInMainCurrencyThere is also an option to add a custom field to the
OrderItem system table and save the tax value during
SetOrderItemInfo execution (in the customized provider).
Maybe even easiest approach would be to add the same custom field to both
OrderItem and
ShoppingCartItem tables.
In that case, the customization of the
ShoppingCartItemInfoProvider would be quite easy, you would just copy the value of the
UnitTotalTax to the custom field (using
item.SetValue()) in the overriden
CalculateUnitTotalTax method, before you just return the value...
When the ShoppingCartItem is stored, the field value will be automatically copied to the OrderItem field of the same name.
Then you could get it in your Invoice directly using a data macro
{%fieldname%} and using the
OrderItem.GetValue("customtaxfieldname") method...
We will hopefully implement this by default in the next versions, but currently, you'll have to use the customization. I would recommend to read about v.6.0 Ecommerce customizations in
New Ecommerce customization model blogpost.
Hope this will be helpful.
Regards,
Zdenek