Skip to content

Conversation

@daun
Copy link
Contributor

@daun daun commented Aug 1, 2025

Updating a product handle in Shopify and resyncing into Statamic currently leads to disconnected variants — the products keep their old slug while the variants are updated to reference the new one. This proposed solution updates the entry slug to always match the Shopify handle. Requires the slug field in the control panel to be set to read-only or hidden. That's how we handle it at least.

Alternatively, one could allow updates to entry slugs inside Statamic, which would require a different change instead. This would/could tie into the overwrite setting, which would make overwriting the slug optional/configurable.

// Import Variant
- $this->importVariants($this->data['variants'], $this->data['handle']);
+ $this->importVariants($this->data['variants'], $entry->slug());

daun added 2 commits August 1, 2025 14:30
Signed-off-by: Philipp Daun <post@philippdaun.net>
Signed-off-by: Philipp Daun <post@philippdaun.net>
@ryanmitchell ryanmitchell merged commit a18a6b1 into statamic-rad-pack:main Aug 1, 2025
4 checks passed
@daun daun deleted the fix/product-handle-updates branch August 2, 2025 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants