CSV & XML export

The plugin can export order data as a CSV or XML file and send it as an email attachment to the supplier, or save it on the server.

The export configuration is done per supplier (under Catalogues > Dropshipping Suppliers > [Supplier]).


CSV export

Basic settings

Field
Description
Example

Send CSV as attachment

Attaches the CSV to the email

✓ active

Delimiter

Field separator

; or , or |

Filename

File name (Twig variables supported)

ORDER_{{ order.orderNumber }}

File path

Storage location on server (starting files/)

files/dropshipping/

Save file

Additionally saves CSV on the server

optional

Defining the header

Enter the column names line by line — each line corresponds to one column:

OrderNumber
OrderDate
NetPrice
TotalPrice
Tax
ProductName
ManufacturerNumber
Quantity

Defining columns

Enter one Twig template per line for the corresponding column. The order must match the header:

Important: lineItems.at(n) is a placeholder. The plugin automatically replaces n with the index of the current line item.


XML export

Basic settings

Field
Description

Export as XML

Switches from CSV to XML format

File path

Storage location on server

Save file

Additionally saves XML on the server

XML structure

The XML file consists of three parts:

Header – output once at the beginning:

Body – repeated for each order line item:

Footer – output once at the end:


Available Twig variables

Order (order)

Variable
Description
Example

order.orderNumber

Order number

10042

order.orderDate

Order date (timestamp)

order.orderDate|date

Formatted date

15.03.2024

order.orderDate|date('d.m.Y')

Date with format specification

15.03.2024

order.orderDate|date('d-m-Y')

Date with hyphens

15-03-2024

order.price.netPrice

Net total amount

84.03

order.price.totalPrice

Gross total amount

100.00

order.price.calculatedTaxes.at(0).tax

Tax amount (first tax rate)

15.97

Order line items (order.lineItems.at(n))

n is automatically replaced by the current line item index.

Variable
Description
Example

order.lineItems.at(n).label

Product name

"T-Shirt Blue XL"

order.lineItems.at(n).quantity

Ordered quantity

2

order.lineItems.at(n).payload.manufacturerNumber

Manufacturer / article number

"MNR-001"

order.lineItems.at(n).payload.productNumber

Shopware product number

"SW10042"

Supplier (supplier)

Variable
Description

supplier.name

Supplier name

supplier.mail

Primary email of the supplier

supplier.additionalMail

Additional email of the supplier

Date formatting

Twig date formatting using PHP date() syntax:

Format
Description
Example

d.m.Y

Day.Month.Year

15.03.2024

d-m-Y

Day-Month-Year

15-03-2024

Y-m-d

Year-Month-Day (ISO)

2024-03-15

d/m/Y H:i

With time

15/03/2024 14:30


Practical examples

Example 1: Simple CSV for an international supplier

Header:

Columns:

Example 2: XML with multiple fields

Example 3: Filename with date and order number

Result: ORDER_10042_2024-03-15.csv


Tips & notes

  • Twig filters: You can use all standard Twig filters, e.g. |upper, |lower, |default('')

  • Missing values: Use |default('') to avoid errors on empty fields: {{ order.lineItems.at(n).payload.manufacturerNumber|default('') }}

  • Encoding: XML files are encoded in UTF-8

  • Delimiter: For numeric values with a decimal comma, a semicolon may work better as the delimiter than a comma

Zuletzt aktualisiert