Skip to content

Handle product deletions and variant assignments #132

@butenkor

Description

@butenkor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions