Skip to content
Stone & Water

Protect Shopware texts from ERP and interface overwrites

Anyone who wants to protect Shopware texts from ERP overwrites knows the problem: the ERP syncs overnight, and in the morning carefully maintained descriptions, SEO texts and translations have been replaced by the master data from the ERP again. The PIM's external system guard remembers the maintained state and restores it.

Key facts
  • Protects name, description, meta title, meta description and keywords per selected language.
  • Reacts to write operations via Shopware integrations that you define as external.
  • Your own changes in the admin and in the PIM refresh the reference state and are never reset.
  • Log with CSV export, console command staw:pim:guard:snapshot and a scheduled task.

ERP sync in standard Shopware

ERP systems, inventory management, supplier PIM systems or marketplace connectors write to the product data via the Shopware API. Many of these connections send the complete product with every sync, including name and description from the ERP. Shopware does not distinguish whether a text in the shop was carefully revised for SEO: the last value written wins. The result is lost working hours, fluctuating rankings and translations that are back in the source language after the next run. Often the interface cannot be configured to skip texts, or the provider charges for an expensive customisation.

Protect Shopware texts from ERP overwrites with the external system guard

You find the external system guard in the config matrix in the "External systems" tab; it is switched off by default. It works in three steps:

  1. Reference state: the PIM stores the protected fields per product number and language in a dedicated table.
  2. Detect: if an integration treated as external writes to product translations, the PIM flags the affected products. Write operations by logged-in users, on the other hand, refresh the reference state immediately.
  3. Restore: fields that differ from the reference state are reset.

Because the reference state is tied to the product number, the guard also works when internal IDs change during a re-import. A field inherited from the parent language is saved as "inherited" and written back the same way.

The settings

  • Enable protection: while it is off, no reference state is recorded and nothing is restored.
  • Protected languages: only these are monitored. Without at least one language nothing happens.
  • Protected fields: name, description, meta title, meta description, keywords, all five by default.
  • Integrations treated as external: a selection from your Shopware integrations. Without a selection every integration counts as external; if you select some, the PIM treats all others like your own changes.
  • Trigger: "Events and scheduled run" (default), "Events only", "Scheduled run only (cron job)" or "Manual only". For automatic restoration, the default setting with both paths is recommended.
  • Wait time between runs: 0 to 3600 seconds, default 60. It prevents the sync from restarting constantly when many write operations happen in quick succession.

Scheduled task, HTTP call and console

The plugin registers the scheduled task staw_pim_direct.translation_guard with an interval of 300 seconds. It processes the flagged products and needs active task processing in Shopware. Without a command line you can instead call the HTTP address shown in the tab via your host's cron service; it is protected by a random key that you can renew at any time with "New key". For large catalogues the console is the better route:

  • bin/console staw:pim:guard:snapshot sets the reference state for all products.
  • --check reports deviations without writing anything.
  • --restore restores deviations across the entire catalogue.
  • --force runs the command even when protection is switched off.

Log and manual restore

The "Reference state and log" section offers "Set reference state", "Check only" and "Restore now". The log shows the latest runs with trigger, checked and restored entries and duration. Via CSV you download the restored products with product number, name and affected fields, handy for clarifying things with the operator of the interface. "Restore now" checks the entire catalogue and therefore also catches changes that bypassed the interface, such as an import straight into the database. The operation cannot be undone.

Step by step: protecting texts from the ERP

  1. Check the texts: make sure the texts in the shop are in the desired state. Exactly this state becomes the reference.
  2. Choose languages and fields: in the "External systems" tab, choose the languages and fields to protect.
  3. Define the integration: select your ERP's integration as external.
  4. Set the trigger: keep "Events and scheduled run" and check that Shopware's task processing is running.
  5. Set the reference: click "Set reference state" or use the console command for large catalogues.
  6. Enable protection and monitor: switch the guard on and check the log after the next ERP sync.
Reference first, then protection: if a text has already been overwritten from outside when you set the reference state, the external text becomes the reference and cannot be brought back afterwards. If in doubt, use "Check only" first.

Use cases

  • Nightly ERP sync: prices and stock keep coming from the ERP, SEO descriptions are preserved.
  • Translations: the English description is no longer replaced by the German ERP text.
  • Several interfaces: only the ERP counts as external; a translation service using another integration may write texts.
  • Direct import into the database: "Restore now" or --restore also brings such changes back.

Frequently asked questions

Will my own changes be reset?

No. Write operations by logged-in users, including those from the PIM, refresh the reference state immediately. Only changes via integrations treated as external are reset.

Which fields can I protect?

Name, description, meta title, meta description and keywords of the product translations, each for the selected languages.

Do I need a cron job?

For automatic restoration, Shopware's task processing must be running. Alternatively you call the HTTP address shown regularly via a cron service.

Which trigger should I choose?

For automatic restoration, the default "Events and scheduled run". Events flag affected products, and the scheduled run processes them.

How do I set the reference state for a very large catalogue?

With the console command bin/console staw:pim:guard:snapshot. In the admin the reference is set in a single request, which can hit the web server's time limit for very large catalogues.

Read more

Try PIM for Shopware

All licence models and terms are listed on the pricing page. Want to know up front whether the PIM fits your shop and your processes? Get in touch via the contact form - we answer personally.

View pricing