Repository navigation
fix(administration): reset the canonical product of duplicated variants - #21292
Merged
Vin Le (vienthuong) merged 3 commits intoOct 9, 2026
Merged
Vin Le (vienthuong) merged 3 commits into
Vin Le (vienthuong) merged 3 commits into
Conversation
Contributor
|
OpenAPI Snapshotℹ️ shopware/store-api — schema identical to base trunkℹ️ shopware/admin-api — schema identical to base trunk |
Sy Dinh (sydinh)
approved these changes
Oct 8, 2026
Sy Dinh (sydinh)
left a comment
Contributor
There was a problem hiding this comment.
looks good, thanks 👍🏻 💙
Lee Nguyen (nguyenquocdaile)
approved these changes
Oct 9, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #21292 +/- ##
=======================================
Coverage 71.23% 71.23%
=======================================
Files 5896 5896
Lines 216750 216750
Branches 12035 12035
=======================================
+ Hits 154397 154402 +5
+ Misses 58527 58523 -4
+ Partials 3826 3825 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Vin Le (vienthuong)
approved these changes
Oct 9, 2026
Contributor
|
The change LGTM, thank you for your contribution Marcus Müller (@M-arcus) 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Why is this change necessary?
When a product is duplicated in the Administration, a variant that stores its own canonical product keeps it, so the copy's variant page names the original product's variant as its canonical URL. Search engines are then told that the copy is a duplicate of the original. #13292 resets
canonicalProductIdwhen the parent is cloned, but the variants are cloned one by one afterwards and only get a newparentIdand product number.(The author of #13292 really should've thought of that)
2. What does this change do, exactly?
Duplicated variants no longer keep a canonical product of their own. They inherit the canonical of the new parent product, which the duplicate already resets, so no page of the copy points to the original product.
3. Describe each step to reproduce the issue or behaviour.
PATCH /api/product/<A>with{"canonicalProductId": "<B>"}).canonicalProductIdin the Admin API, or<link rel="canonical">on its storefront page).4. Please link to the relevant issues (if any).
#13292
5. Checklist
RELEASE_INFO-6.<major>.mdunder “Upcoming” for informational changes, including the consequences of the change and how it affects external developers.UPGRADEsection inUPGRADE-6.<next-major>.mdfor breaking changes (what/why/impact/how to adapt).