Skip to content

Export Data Modification

Use Data modification when an export file must follow a partner format that differs from your Shopware data. The script runs for each mapped export row before writing, so the export stays memory efficient even for large files.

  1. Open or create an export profile.
  2. Go to Advanced options.
  3. Enable Data modification.
  4. Enter your PHP script in the editor.
  5. Save the profile and run the export.

The script can use these variables:

VariableDescription
$rowThe current mapped export row as an array. Change values in this array to change the exported row.
$skipRowSet this to true to omit the current row from the export file.

Input value:

"-408200-0096-0100"-DE

Script:

<?php
$row['productNumber'] = 'G' . str_replace(['"', '-DE'], '', $row['productNumber']);

Exported value:

G-408200-0096-0100

Use $skipRow = true when a row should not be written to the export file.

<?php
if ($row['stock'] <= 0) {
$skipRow = true;
}

For security reasons, only a limited set of common PHP functions is allowed. File access, includes, eval, exit, and similar constructs are blocked. If a forbidden function is used, the script is not executed for the row.