Updating Related Product Attributes with a CSV
This guide will show you how to update an attribute value for a given product relation using the CSV Related Product Attributes Importer.
Let’s imagine that we have a product (name (sku)) “Vintage Cassete Player (vintageA)” and that this product have two product relations with attributes and, under each of these relations, two related products:
Relation: “Customer Also Bought”
Product: “Vintage Vinyl Player (vintageB)”
Product: “Vintage CD Player (vintageC)”
Relation: “Recommended”
Product: “Retro Gaming Console (retroA)”
Product: “Retro Jukebox (retroB)”
Attribute: “Call to Action (text)”
Attribute: “Golden Tags (multiselect) (select values: Pro, Tech, Hype, Hot, Avant-garde)”
To update each attribute value of each product under each relation type we will need fill in a CSV file with the following headers structure:
Product (ID or SKU): The ID or the SKU of the product.
Related Product (ID or SKU): The ID or the SKU of the related product.
Relation Type Name: The name of the product relation type.
Attribute Name: The name of the attribute.
Attribute Value: The value to be set. If the attribute is a “multiselect” one then you can pass multiple values by separating each of them with a comma. Like, in our example, for “Golden Tags” we could write “Hot, Tech, Avant-garde”.
You can also download a CSV template at “Import/Export > CSV Importers > Related Prod. Attributes > Download Example CSV Template”.
All columns are case sensitive, always check your CSV file for typos.
How our final CSV file will look like:
Now you just have to import this file into “Import/Export > CSV Importers > Related Prod. Attributes” and voilà!
You can also use the importer to clear the attribute values, for that just leave the “Attribute Value” entry empty at the line you want to do that. In the file below we are clearing the attribute value for product “vintageA”, related product “vintageB”, relation “Customer Also Bought” and attribute “Golden Tags”:
If something does not work as you expected check the logs for “Import Related Product Attributes from CSV” on the “Jobs” page, there you’ll find more details about what went wrong during the import process.