Here is a sample batch report to get you started.
It assumes all your orders have the same payment type. If you accept paypal or POs or something like that, this breaks down because it will always pull the header row from the first order in batch report
Code:
<mvt:assign name="g.comma" value="asciichar(44)" /> <mvt:assign name="g.new_line" value="asciichar(10)" /> <mvt:foreach iterator="order" array="admin_order:orders"> <mvt:if expr="l.pos1 EQ 1"> <mvt:foreach iterator="field" array="order:payment:fields"> &mvt:field:label;&mvt:global:comma; </mvt:foreach> &mvt:global:new_line; </mvt:if> <mvt:foreach iterator="field" array="order:payment:fields"> &mvt:field:value;&mvt:global:comma; </mvt:foreach> &mvt:global:new_line; </mvt:foreach>
This should output a single header row followed by the payment data for each order. Here is a sample output
Code:
Card Type:, Name on Card:, Card Number:, Expiration Date:, Visa, Brennan Heyde, 4111111111111111, 2/2015, Visa, Test Order, 4111111111111111, 2/2015,
To get it to output to a csv file, go to items, then assign the http_headers item.
Then within that tab add the following two headers:
Content-Type text/csv
Content-Disposition attachment; filename="payment_export.csv"
Leave a comment: