I'm trying to create a custom report. In it, I need a table with rows that would look like this:
# Product Order id Order date
1 Partridge 1234567 2014-09-15
2 Dove 1234567 2014-09-15
12 Drummer 1234567 2014-09-15
3 Dove 2345678 2014-08-01
4 Drummer 2345678 2014-08-01
Clearly this involves a loop over orders, and an inner loop over the items in the order. However, I haven't been able to access much of the order's data from within the item's loop. While i can see the order ID, I can't seem to access the date the order was entered; instead, entry_date
gives the product's creation date, which is not what I want at all. Other attempts -- starting a second-level exp:channel:entries
loop with the appropriate order ID, guessing at possible prefixes or containers for order data (like entry:entry_date
or order:entry_date
) haven't gotten me anywhere. The following is the code I've written for this so far.
<table>
{exp:channel:entries channel="orders"}
{order_items variable_prefix="item_"}
<tr>
<td>{item:quantity}</td>
<td>{item:title}</td>
<td>{order_id}</td>
<td>{entry_date}</td>
</tr>
{/order_items}
{/exp:channel:entries}
</table>