Search code examples
importshopwareshopware6

Import properties, how get the id? Shopware6


I have a problem with the Shopware 6 import for properties. I would like all properties to be imported with the respective name of the property and the name of the value, instead of id and group_id. Is there a way to be able to do this? Currently this would always just duplicate. If not, is there a way to get the ids efficiently before starting an import?

I tried to just leave the ids empty but this not working. Just duplicating the properties.

Thanks a lot.


Solution

  • For the import you can use the Advanced Settings to set an alternative identifier for each entity imported, as defined by the mapping of CSV column to field.

    First you'll need to duplicate the default profile for properties and may then edit the duplicated profile. Then under Advanced Settings you can find the entities for property groups and options. For both of them you may change the identifier from id to translations.DEFAULT.name. At that point you may also delete the id and group.id fields from the mapping. From then on you can import properties and their respective group simply by using the name as identifier. So if a property with the exact same name already exists, it will be updated instead of created. Keep in mind that this change will obviously not allow properties with the same name to exist twice.