With a big catalog of 224+ extensions for your online store
How to Import Configurable Products in Magento 2
As far as we know, Magento 2 Configurable Products is a useful tool for both customers as well as store owners. If the products are configurable, it means that the customers can purchase them according to their needs, hobbies or the requirements from a list of available options easily. Thanks to it, there is a high chance that they make quicker purchase decisions, and stores can boost sales in no time.
Importing a single product in Magento 2 can be easy; however, the configurable product import process may seem more complicated to some businesses. Adding one by one is not a practical answer, so you still need a solution to help import these data in bulk.
In this article, we will show you how to import configurable products in Magento 2. It is implemented according to the three following steps.
Step 1: You need a CSV file to Import Configurable Product
You need your Magento 2 admin panel before downloading a sample CSV. Log into the backend and navigate to System
> Import
In here, the Import Settings tab will be displayed
In Import settings
field, choose Products
> click Download Sample CSV
as image below:
In the Import Behavior
tab, choose Add/Update
to import configurable products as the image above. All other configurations are set up as available default. In case you already have a CSV file, you can skip this step.
Step 2: Fulfill CSV file (Input your configurable product and simple product)
The sample configurable products after downloading:
Some notes you need to know before filling in the CSV file
- Need to list all children products before configurable product.
- Make sure that the value in the ‘attribute_set_code’ column always matches the name of the Attribute Set.
- You should list all the values of the attribute set for each child product from in the ‘additional_attributes’ column.
- Follow the pattern in the file as the set of SKUs and Options in the ‘configurable_variations’ column.
- Get the correlation between the Attribute code and the Label name in the ‘configurable_variation_labels’ column.
Step 3: Import CSV file
Now, navigate to System
> Import
. In the File to Import
field, click on Choose File
to upload your CSV file. Then, click on the Check Data
button on the right corner.
There will be a notified message if your CSV file has no errors like the image below:
Next, click Import
button, a successful notification will be shown as below:
Finally, go to the frontend to check again.
How To Export Magento Configurable Products Together With Associated?
How To Export Magento Configurable Products Together With Associated?
Exporting configurable products with their simple counterparts in Magento is easy with the Data Transfer Tool. First, head to System > Data Transfer > Export.
Then, select Products
in the Entity Type
field, and CSV in the Export File Format
field.
Enter the SKU of the product you want in the Entity Attributes field, then click Continue. The download will start right away. If you’re looking for a more advanced Import/Export solution, explore our Import and Export extension.
How To Import a Custom CSV File Programmatically In Magento 2?
To import a custom CSV file into Magento 2 using code, you can follow this code:
$import = \Magento\Framework\App\ObjectManager::getInstance()->create('Magento\ImportExport\Model\Import');
$import->setData([
'entity' => 'catalog_product',
'behavior' => 'append',
'validation_strategy' => 'validation-stop-on-errors',
'allowed_error_count' => '10',
'file_path' => 'path/to/custom_csv_file.csv',
'import_images_file_dir' => 'path/to/import_images/',
'images_file_mode' => 'move',
'import_images' => 'true',
'field_separator' => ',',
'multiple_value_separator' => ',',
'store_id' => '0',
'website_id' => '0'
]);
$result = $import->importSource();
In this code snippet, we start by creating an instance of the Magento\ImportExport\Model\Import
class using the Object Manager. This class is responsible for handling imports in Magento 2. We then set various import parameters, such as the entity type (in this case, ‘catalog_product’), behavior, validation strategy, allowed error count, file path pointing to the custom CSV file, and other options related to image import.
After configuring the import settings, we execute the import process by calling the importSource
method on the $import
object. The result of the import operation is stored in the $result
variable.
The important thing to remember is that you can change this code to fit your needs. If you need to, you can change the import settings or use it for different types of entities. You can change the import process to fit the specifics of your Magento 2 setting because of this.
Conclusion
This is the fastest way to import configurable products in Magento 2. Be an intelligent store owner by meeting the satisfaction of the customers with only three simple steps. Do not hesitate anymore, follow those steps now!
Feel free to comment below or share it with your friends and business partners.
Some related posts:
Looking for Magento Development Company?
8+ years of experiences in e-commerce & Magento has prepared us for any challenges, so that we can lead you to your success.
Get free consultantRecent Tutorials
How to insert Order Attributes to Transactional Emails
How to insert Order Attributes to Transactional Emails
How to add Order Attributes to PDF Order Template
Explore Our Products:
People also searched for
- import configurable product in magento 2
- magento 2 import configurable products sample csv
- magento 2 import configurable products
- magento import configurable products sample csv download
- import configurable products magento 2
- magento configurable product import
- magento import configurable product
- simple configurable products magento 2
- magento import configurable products
- import configurable products magento
- magento import export configurable products
- magento 2 configurable product import csv
- magento 2 configurable product import
- magento simple configurable products
- magento 2 convert virtual product to simple
- magento 2 simple configurable products
- 2.3.x, 2.4.x
Stay in the know
Get special offers on the latest news from Mageplaza.
Earn $10 in reward now!