The import system for product attributes in Orocommerce is too destructive

117 views Asked by At

I've been using Orocommerce for a while now, and I'm facing a problem that could be very problematic in the long term.

I extensively use the product attributes system in Orocommerce for almost all of my products (for things like color, material type, etc). And for internal purposes, they are all enum types.

Since I handle a lot of different attributes and attribute values, I use Orocommerce's import system to import CSV files containing my attributes and their values (with the enum.enum_options.X.label field, where X is replaced with a number).

Through testing, I discovered that this system is rather destructive: The CSV files absolutely need to contain all the enum values that already exist on Orocommerce (plus the ones that I need to add) before importing this file, or else any attribute value that already exists on Orocommerce, but isn't present on the imported file will get permanently deleted, resetting all products that were using these attribute values back to "N/A".

For example, if I have a "Color" attribute, and already have Green, Blue, and White, but want to add the color Red, I will have to import a CSV that contains Green, Blue, White and Red. If I forget to add White to the file and import it, the attribute will get removed from Orocommerce, no questions asked.

This is much, much too destructive because it is possible, through importing a single attributes CSV, to destroy all products on the platform. There are absolutely no guardrails that makes the import fail if products already use this attribute value.

Is there a setting that makes it so that the import system only adds new attribute values, and doesn't delete any, or make it so that the import fails if attribute values that are already used on products is about to get deleted?

Any help on this would be appreciated.

1

There are 1 answers

0
Andrey Yatsenko On

You can always override the default import strategy or a whole import job to match your requirements. For more details, see the import architecture guide.