This guide will walk you through how to import configurable products in Magento 2 using CSV file.
Step 1: Prepare your CSV file
Go to your Magento Admin > System > Data Transfer > Import.
From the Entity Type drop-down selections, choose Products and make sure your File Format is CSV.
In Import Behavior, click and choose Add/Update.
After which, click on the Download sample file and you’ll receive a .CSV file containing the products whose SKUs you just put down.
Step 2: Complete the CSV file
Open your downloaded CSV file.
You’ll see that other fields in the CSV import file of configurable products are the same as the file of simple products. Yet, with configurable products, you’ll need to add some fields and follow the instructions:
- List children products before configurable ones
- Make sure the value in the ‘
attribute_set_code’ column matches the name of the Attribute Set.
- Add the ‘
additional_attributes’ column and enumerate all the attribute set values for each child product. Put the attributes in the format as
atrribute_value, separated by a comma.
- Add the ‘
configurable_variations’ column and fill in the set of SKU and Option (only for the parent products). Put the products in the format as SKU =
attribute_value, separate by ‘|”. The value attribute must correspond to the product value.
- Add and check the correlation between the Attribute Code and the Label name in the ‘
configurable_variation_labels’ column (only for the parent products). Here you’ll declare an attribute in the format as
attribute_label, separated by a comma.
Step 3: Import CSV file
Go back to your Magento backend, go to System > Data Transfer > Import.
Then go to File to Import > Select File to Import. Select the file you want to import into your Magento store system.
And click on Check Data on the right corner.
You can leave other fields as they already are by default.
After the data checking process completes, you can proceed to import if the checking result is valid, else you need to edit your CSV file until it is free of error.
Click Import to start the import process. When everything’s done you will receive the below success message.
Now you can go to your frontend to check the result.