Keep Identifers Stable When Domain Change

When migrating a Shopware environment from staging to production, the domain configuration changes. Historically, the Tweakwise Shopware plugin generated product and category IDs based on this domain configuration. As a result, changing the domain during a go-live would regenerate all IDs, immediately breaking your existing Tweakwise configuration (merchandising rules, categories, and recommendations).

To resolve this, we introduced this stable id setting. This decouples ID generation from the domain name, ensuring your product and category IDs remain consistent across environments. This document explains how to enable this setting to ensure a smooth transition when going live.

Instruction

In Shopware admin, go to Extensions → My Extensions.

Search for Tweakwise, click Configure.

Enable "Keep Identifiers stable when domains change".

Generate a New Feed: Trigger a new feed generation so the updated IDs are exported to Tweakwise.

Important Considerations

  • Existing Implementations: Do not toggle this setting on a live environment that has an already configured and active Tweakwise instance. Enabling this setting changes all IDs in the feed. Tweakwise will see these as entirely new items, which will break existing lister pages, merchandising rules, and recommendations.
  • Timing: Only enable this setting before your initial Tweakwise configuration, or specifically during a planned migration where you expect to remap your Tweakwise setup.

FAQ

Q: What happens if I accidentally turn this on in an existing production environment?
A: Your product and category IDs will change in the next feed export. Tweakwise will process this as a full catalog deletion and recreation. Your existing configuration (sorting rules, pinned products) will break because the old IDs no longer exist. If you do this by accident, revert the setting immediately and push a new feed.

Q: Does this setting affect how I call the Tweakwise API for search or recommendations?
A: Yes. If you rely on API endpoints for Smart Search or Recommendations, you must ensure your frontend passes the newly generated stable IDs. Always verify that the IDs your Shopware frontend uses match the IDs present in the Tweakwise feed.

Q: Are category IDs affected in the exact same way as product IDs?
A: Yes. The stable ID generation logic applies to both categories and products, ensuring your entire catalog structure remains intact regardless of the active domain configuration.