The article you are viewing corresponds to our latest version. If you are using version ‘3.8.5’ and below, refer this article.
The WooCommerce variable product helps to create multiple variations of a single product. This will save time and effort for store owners from creating variations from scratch. We can create variable products using product attributes. The Product Import Export Plugin for WooCommerce imports and exports variable products in a convenient manner.
An important step during import is to map the column header of the CSV file correctly with the fields of WooCommerce so that all the product variations and attributes come up without any problems.
Note: The CSV Import file must be in UTF-8 format. For more information about UTF-8 encoding, refer How to save CSV / Excel File as UTF-8 Encoded?
Sample use case
To import variable products from a CSV file:
Let’s consider we have a variable product ‘Men’s Cotton T-shirt’ with four variations. The two attributes for creating variations are – Color (Blue & Red) and Size (M & S).
The four variations are represented by SKUs as:
- CTS1 (Red-M)
- CTS2 (Blue-M)
- CTS3 (Red-S)
- CTS4 (Blue-S)
Mandatory columns for variable products
Note: For every attribute(example: size) in the CSV, the following 4 columns are required.
- meta:attribute_size – This defines the values of the variations.
- attribute:size – This defines all the possible values for the parent product.
- attribute_data:size – This column is explained below
- attribute_default:size – It is the default size that will be displayed on the cart/checkout page.
Input the field meta only for the child products. Likewise, input the other three fields – attribute, attribute_data, and attribute_default only for parent products. Leave the default attribute field blank as it is optional.
Now, let us take a look at the column attribute_data with values displayed in the form of position | visible | variation.
- position: Defines the position of the attribute in the front-end. For example: variations with 3 attributes and position value 0, will appear at the top of the variations list.
- visible: Attributes visible at the front-end will dislay the value as 1. Otherwise, it will be 0.
- variation: Attribute used for variation will display the value as 1. Otherwise, it will be 0.
Use the sample CSV of variable product and provide data only for the parent products rows for fields like attribute:size and attribute_data:size. The variations should not have any value for these columns.
Note: Download Sample CSV of Variable Product
Steps to import variable products
As a first step, install and activate the product import export plugin. Next, click on WebToffee Import Export (Pro) > Import menu from the WordPress admin panel.
- Select Products under post type.
- Select an import method: Quick import, Pre-saved template and Advanced import are the provided import methods.
- Map import columns: To map import columns. Here, you can map the commercial names to WooCommerce columns. Use Evaluation Field to fix/update the required value for a particular field.
- Advanced Options/Batch Import: Provides advanced options to import and scheduling import.
On successful import, the variable products will appear as:
Variable Products In WooCommerce Store
We can view the imported products in the WordPress admin panel and in the website of WooCommerce store.
- To view the imported products in the WordPress dashboard, click on Products>All Products:
- To view its variations, click on the product and move to the Variations section of the respective product page.
- The color variations in the product page will appear as shown below:
- The size variations in the product page will appear as shown below:
Other related articles: