This PR has the following changes for the main variation relation ship:
1.) I found a issue, that allways the sync linked the first variation as main variation. If a product has more then one variation, but only one variation is active, the product is not displayed on the store. A inactive variation is the main variation, but if the main variation is not active, the product is not active in the store.
I fixed it in the following steps:
if the config was set, that use the inactive main variation, the product will be inactive.
if the config was not set, check the main variation is active, take the main variation in plenty as main variation in shopware, otherwise take the first active variation
if the main variation in plenty is not a full variation with attributes, then take the variation which is active, otherwise take the first variation in the array
2.) If the variation sync change variation of an product, so change the edit datetime of the product and change the active status of the product.
3.) Add new methods to the variationHelper.
Checklist
[x] Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
What's in this PR?
This PR has the following changes for the main variation relation ship:
1.) I found a issue, that allways the sync linked the first variation as main variation. If a product has more then one variation, but only one variation is active, the product is not displayed on the store. A inactive variation is the main variation, but if the main variation is not active, the product is not active in the store. I fixed it in the following steps:
2.) If the variation sync change variation of an product, so change the edit datetime of the product and change the active status of the product.
3.) Add new methods to the variationHelper.
Checklist