Case study 3: Importing a product with options and variations

This article is part of the catalog import and export section and tells you how to manage products with options and variations in your store with a CSV file.

You can import new products with options and variations, or you can import options and variations for products that already exist in your store.

If you import data on product variations, all the other variations that already exist for this product in your store and are not present in the file will be deleted. The options, however, will remain.
If you want to create new options and variations in your store, we recommend including rows with data on both options and variations in your file.

In this section, you’ll learn how to import a new product with both options and variations into your store.

In our example, we’ll use the same sample product:

A black dress from this season’s collection that costs $25, weighs 1 lb, and already has an SKU (A0001).

Let’s say it has three “Size” options (with values “S”, “M”, and “L”) and two “Color” options (with values “Total black” and “Black with floral pattern”). All the options cost the same, and you want to display them as radio buttons on the product page without preselecting a certain option.

Based on these options, the product has six variations. All the “Total black” ones cost $25, and all the “Black with floral pattern” ones cost $30. Each product variation has its own SKU.

You can compile your file in any spreadsheet editor (or in a plain text editor). In our example, we’ll use Google Sheets.

To create an import file:

  1. Open your spreadsheet editor.
  2. Enter “type” in the first cell. Then enter “product” in the row below it, and fill out all the other columns for the product itself (See Case study 1).
  3. In the following rows, add data on “Size” and “Color” product option values (see Case study 2 for the algorithm).
  4. In the next row, enter “product_variation” in the “type” column:

    Catalog import case studies (24).png

    Now you’ve specified that this row is about a product variation.
  5. In the “product_sku” column, enter “A0001” again. That’s the SKU of the product this variation belongs to. By specifying it, you let the import tool know which product in your store this variation goes to.
  6. Add the “product_variation_option_Size” column to the file header and enter “S” as its value for the “product_variation” row:

    Product variation (1).png

    Now you’ve specified that the variation in this row is formed based on the size “S” option.
  7. Then add the “product_variation_option_Color” column to the file header and enter “Total black” as its value for the same “product_variation” row.
    Now you’ve specified that the variation in this row is also formed based on the “Total black” color option.
  8. So, by now, you’ve specified that this row is about a size “S” + “Total black” color variation.
    Now you can enter its price ($25) into the “product_price” column for the “product_variation” row. Yes, you can use the same “product_price” column both for your products and for their variations!
  9. Next, add the “product_variation_sku” column to the file header and enter “A00011” (or any other SKU you like) as its value for the “product variation” row.
    This way, you set the SKU for this particular product variation.
  10. Congrats! You have entered all the data you need for the size “S” + “Total black” color variation.
    Now add a new “product_variation” row and repeat the process for the size “M” + “Total black” color variation. Then for then size “L” + “Total black” color variation, size “S” + “Black with floral pattern” color, etc., until you have all the variations covered.
    In the end, every product variation must have its own row.
  11. Now save/download the file as .csv to your device. In Google Sheets, you can do it by going to File → Download → Comma Separated Values (.csv).

That’s it! You’ve compiled a file for the “Black Dress” product with three size options, two color options, and six variations that are based on them. You can find the “product_with_options_and_variations” file in the article attachments.

For existing products, you can add options and variations without specifying other product details in the spreadsheet (just its SKU or ID will be enough). In other words, you can skip the whole “product” row.

After you upload this file on the Catalog → Data Import & Export page, the product will be added to your store. Here’s how options and variations will look on the Options tab in your store admin:

Product variation (2).png

As you can see, this new product will have all the product options and variations from the initial list.

Now you can choose any product with options and variations from your catalog and follow these instructions step by step to compile your own import file. If you need to add several different product options and variations to a product or several products with product options and variations, simply add rows with data on them to the same file.

If later you need to update options and variations for your product, we recommend creating and uploading a new file that will contain all the option and variation data that you need your product(s) to have after import. However, if you want to update existing product variations and don’t need to make changes to existing product options, you can include only the rows with the variation data in your file (and exclude the rows with data on options).

See the list of available product option and variation columns →

Was this article helpful?

Awesome! Thanks for your feedback!

Thanks for your feedback!

Sorry about that! What went wrong?
0 out of 0 found this helpful
We use cookies and similar technologies to remember your preferences, measure effectiveness of our campaigns, and analyze depersonalized data to improve performance of our site. By choosing «Accept», you consent to the use of cookies.
Accept cookies Decline