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.
Enable Data Modification
Section titled “Enable Data Modification”- Open or create an export profile.
- Go to Advanced options.
- Enable Data modification.
- Enter your PHP script in the editor.
- Save the profile and run the export.
Script Variables
Section titled “Script Variables”The script can use these variables:
| Variable | Description |
|---|---|
$row | The current mapped export row as an array. Change values in this array to change the exported row. |
$skipRow | Set this to true to omit the current row from the export file. |
Example: Change a Product Number
Section titled “Example: Change a Product Number”Input value:
"-408200-0096-0100"-DEScript:
<?php$row['productNumber'] = 'G' . str_replace(['"', '-DE'], '', $row['productNumber']);Exported value:
G-408200-0096-0100Example: Skip Rows
Section titled “Example: Skip Rows”Use $skipRow = true when a row should not be written to the export file.
<?phpif ($row['stock'] <= 0) { $skipRow = true;}Security Limits
Section titled “Security Limits”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.