Hi Lucas,
The Order custom data can by displayed using either of these macros:
{% Order.OrderCustomData.State |(user)zbynekh|(hash)afd42a002e86cd590b2db51eaa6bf165f0c67f64e7fc38383947c53e0263a7e2%}
{% Order.OrderCustomDate["State"] |(user)zbynekh|(hash)7e7c20fc60efa0d6ed3c5256716b333134dfeb698add30dece33bbd1be765a2c%}
However the OrderItemCustomData are not available from the invoice. The only solution in this case is to modify the method that generates the ContentTable and add a column for your value from custom data. Afterwards you simply refer to this new column by placing macro {% CustomState %} in transformation Order_ContentTable.
The ContentTable is created using method CreateContentTableInternal, and each item row filled using method CreateContentRowInternal in the ShoppingCartInfoProvider. Using Custom Info Provider, you can override the methods like this, to define and add a value for any custom column:
/// <summary>
/// Creates an empty shopping cart content table.
/// </summary>
protected override DataTable CreateContentTableInternal()
{
DataTable dt = base.CreateContentTableInternal()
dt.Columns.Add(new DataColumn("CustomState", typeof(string)));
return dt;
}
/// <summary>
/// Creates one row of the content table with the data which are retrieved from the specified shopping cart item.
/// </summary>
/// <param name="item">Shopping cart item</param>
/// <param name="table">Table from which the content row is created</param>
protected override DataRow CreateContentRowInternal(ShoppingCartItemInfo item, DataTable table)
{
DataRow row = base.CreateContentRowInternal(item, table);
row["CustomState"] = item.CartItemCustomData.State;
return row;
}
Note the use of CartItemCustomData instead of OrderItemCustomData. This ContentTable is shared between the invoice and the Shopping Cart content dialogue, so doing this will also allow you to read this value in the shopping cart.