Case study 2: Importing a product with options or input fields
You can import new products with options or input fields, or you can import options or input fields for products that already exist in your store.
In this section, you’ll learn how to import a new product with options 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: S, M, and L. All the options cost the same, and you want to display them as radio buttons on the product page without preselecting a certain size option.
To create an import file:
- Open your spreadsheet editor.
- 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).
- In the next row, enter “product option” in the “type” column:
Now you’ve specified that the third row is about a product option.
- In the “product_sku” column, enter “A0001” again. That’s the SKU of the product this option belongs to. By specifying it, you let the import tool know which product this option goes to.
- Add the “product_option_name” column to the file header and enter “Size” as its value for the “product option” row:
Now, this product row is dedicated to the product option that’s named “Size”.
- Next, add the “product_option_value” column to the file header and enter “S” as its value for the “product option” row.
This way, you specify that this product row is dedicated to the “S” value of the “Size” product option.
- Then add the “product_option_type” column to the file header and enter “RADIOBUTTONS” as its value for the “product option” row.
This way, you define that your product option must be displayed on the product page as radio buttons.
- Next, add the “product_option_is_required” column and enter “TRUE” as its value for the “product option” row:
This way, you define that you want customers to select an option value.
- Congrats! You have entered all the data you need for the “S” value of the “Size” product option. Now add a new “product_option” row. It will be dedicated to the “M” value of the “Size” product option.
- Enter “A0001” for “product_sku”, “Size” for “product_option_name”, “RADIOBUTTONS” for “product_option_type”, and “TRUE” for “product_option_is_required” columns. In the “product_option_value” column, enter “M” for this row.
- Now add a new “product_option” row and repeat the process for the “L” value of the “Size” product option.
In the end, every product option value must have its own row.
- 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: S, M, and L displayed as radio buttons (you can find the “product_with_options” file in the article attachments):
After you upload this file on the Catalog → Data Import & Export page, the product will be added to your store. Here’s how the Options tab will look in your store admin:
As you can see, this new product will have all the product options from the initial list as radio buttons.
Now you can choose any product with options 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 (or input fields) to a product or several products with product options, simply add rows with data on them to the same file:
If later you need to update options for your product, we recommend creating and uploading a new file that will contain all the option data that you need your product(s) to have after import.