Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When adding a new product to a store, the SKU should only be unique for that store, rather than globally across all stores.
Comments
Comment #1
joshtaylor CreditAttribution: joshtaylor commentedPR: https://github.com/commerceguys/commerce/pull/195
Comment #2
joshtaylor CreditAttribution: joshtaylor commentedActually on second thought, this will require tests.
Comment #3
rszrama CreditAttribution: rszrama commentedIt seems to me this may also need a validator to ensure you cannot change the store ID of the product to that of another store that already contains the same SKU.
Comment #4
bojanz CreditAttribution: bojanz commentedThe UI assumption is that you will never be able to change the store_id, just like you can't change the bundle.
On the code level, we should check if core does anything to prevent bundle changes, and follow its lead.
Comment #6
bojanz CreditAttribution: bojanz commentedReverted in https://github.com/commerceguys/commerce/commit/4bfdcd6ef875aaf4656bdafb..., as a part of preparing for the new product architecture (which will allow a product to belong to multiple stores).
I've done some investigating, and other ecommerce systems (which allow multistore and products in multiple stores, for example Magento) keep the sku validation global. Sites can always use a sku prefix to get around this in certain cases.