AF WP WooCommerce

Adapted from: https://docs.woocommerce.com/document/product-csv-import-suite-importing-product-variations/

Importing Product Variations

It is possible to import variations to your products using the Product CSV Import Suite. To do this you will need to create a CSV with your variations.

Step 1 – Import Parent Products

Variations are children of variable products. In order to import variations you must first import the parent products.

Before importing your variations, the product must already have the correct attributes created in your original import. To add a global attribute, that can be used for any product, add a column titled attribute:pa_attribute replacing pa_attribute with your attribute name; e.g. attribute:pa_colour. The next column tells the importer whether to use this attribute for variations.
To tell the importer to use an attribute for variations use the column attribute_data:pa_attribute replacing pa_attribute with your attribute name; Read the column reference’s document to know more about these columns and for usage examples.
To set a default attribute in your original product, you should add the column attribute_default:pa_attribute; e.g. attribute_default:pa_colour, and then add the default term in the field.

If you haven’t added these fields to your original CSV, you can input them now and merge your CSV with items already imported.

Step 2 – Create Your Variations CSV

Create your CSV using the sample – we have created a sample for you to use. Then add the columns required for Variations as shown here. You can find a complete list of variations columns in the column reference document.

If you are planning to import product images for your variations, be sure to read this FAQ.

To map your variations to a product, you must include the ID in the post_parent column or the SKU in the parent_sku, of the parent product. This will tell the importer which product your item is a variation of.

Usually, the minimum columns you’ll need for your variations CSV will be the following:

  1. parent_sku or post_parent to map to a parent variable product
  2. sku for the variation
  3. regular_price / sale_price for the variation
  4. Columns to map each variation to an attribute of the parent product

Mapping Product Attributes to variations

Variations are mapped to certain attributes via a meta column prefixed with attribute_.

If, for example, the parent product had a ‘size’ attribute (which was global and found in Products > Attributes) you would use meta:attribute_pa_size as the column name.

For global attributes, the value would be the ‘slug‘ of the attribute. For example, a term called ‘Extra Large’ would likely be ‘extra-large’ in slug form. Use this value.

If the variation is mapped to ‘any’ attribute term, leave the value blank.

You can view the attributes slug by going to Products > Attributes and looking at your terms. They are usually lower case and have no spaces.

If the parent product had a ‘Color’ attribute (which was local and can be found in the product in Product > Product Data > Attributes) you would use

meta:attribute_Color as the column name (note the caps and that we are not using pa_ in the column name).

For local attributes, the value would be the regular value of the attribute. For example, a term called ‘Light Blue’’ would be written exactly like ‘Light Blue’ in the CSV.

Step 3 – Upload Your CSV

Navigate to WooCommerce > CSV Import Suite and click Import Variations.

Product CSV Import Suite - Import Variations

Choose your file and click Upload file and import.

Product CSV Import Suite - Upload CSV

Step 4 – Map Your Fields

Check the fields to make sure that all of the columns are mapping to the correct fields in WordPress.

Product CSV Import Suite - Map Fields

Click Submit. Your product variations should now be imported and ready to go.

Record a reflection ...

This site uses Akismet to reduce spam. Learn how your comment data is processed.