Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle product deletions and variant assignments #116

Closed
butenkor opened this issue Oct 6, 2017 · 2 comments
Closed

Handle product deletions and variant assignments #116

butenkor opened this issue Oct 6, 2017 · 2 comments
Assignees

Comments

@butenkor
Copy link
Member

butenkor commented Oct 6, 2017

Description

It might happen that product is created with wrong variant assignment. Example:
Product with key 1: sku 1
Product with key 2: sku 2
Product with key 3: sku 3

At some point external data (CTP project, CSV, XML...) changes to:
Product with key 4: sku 1, sku 2, sku 3

Currently this will lead to an error that Product 4 can not be created as sku 1, 2 and 3 are already in use in other products. Handling above scenario manually is time intensive and error prone and it gets very problematic if the change has to be distributed for example from master to multiple another CTP projects.

Expected Behaviour

Product 4 should be created with sku 1, 2 and 3 and all conflicting products or variants deleted.

To clarify

  • Should product 1,2 and 3 be deleted or only its variants? Consider for example that Product 1 could have also variant assigned with sku 4?

  • Shall sync decide what to do in this case or rather provide callback so that the user of the library has control?

  • Consider optional migration of existing data* from deleted variant product 1, sku 1 to recreated one product 4, sku 1 variant.

    Existing data: data which might be set only once by another import process and is not available in new variant/product data. Good candidates are prices or other attributes/flags like product approval.

  • Consider other use cases if above example is inverted.

Related

commercetools/commercetools-sync-java#132

@Oehmi
Copy link

Oehmi commented Dec 5, 2017

@lojzatran @butenkor Do you happen to know if this will be part of the new Importer API?

@butenkor
Copy link
Member Author

butenkor commented Dec 5, 2017

@Oehmi It is being implemented in external library (https://github.com/commercetools/commercetools-node-variant-reassignment) and later integrated here. AFAIK new importer API will be using https://github.com/commercetools/commercetools-sync-java and here we will need to apply same logic: commercetools/commercetools-sync-java#132

junajan added a commit that referenced this issue Jun 6, 2018
* feat(product-import): Filter out failed products #116

* chore(product-import): Refactor code - DRU #116
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

No branches or pull requests

3 participants