How can I import configurable products with a CSV on Magento 2?

First of all, I am happy to be part of this community and I hope I can help someone in need.

The other day I was given a CSV from a store that I had to convert into a CSV compatible with Magento. That was the easy part, I made a script and it's doing it perfectly. However, when the product is configurable, it's not working as intended, the simple products that should be linked to it are not.

At first, I was thinking that maybe something was wrong with my CSV, so I thought that I would use a sample CSV to import and see what exactly I was doing wrong. But, to my surprise, I used this CSV and it had the same problem

sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,crosssell_skus,upsell_skus,additional_images,additional_image_labels,hide_from_product_page,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,configurable_variations,configurable_variation_labels,associated_skus shirt-black,,Default,simple,Default Category/Gear/Bags,base,T-Shirt - Black,,,1,1,Taxable Goods,Not Visible Individually,1,,,,,,,,,,,,,,,,1/23/2016 19:45,1/23/2016 19:45,,,Block after Info Column,,,,,,,,,,,,,color=Black,5,0,1,0,0,1,1,1,0,1,1,,1,0,0,1,1,0,0,0,1,,,,,,,,,,,,,, shirt-red,,Default,simple,Default Category/Gear/Bags,base,T-Shirt - Red,,,1,1,Taxable Goods,Not Visible Individually,1,,,,,,,,,,,,,,,,1/23/2016 19:45,1/23/2016 19:45,,,Block after Info Column,,,,,,,,,,,,,color=Red,5,0,1,0,0,1,1,1,0,1,1,,1,0,0,1,1,0,0,0,1,,,,,,,,,,,,,, shirt,,Default,configurable,Default Category/Gear/Bags,base,T-Shirt,,,1,1,Taxable Goods,"Catalog, Search",,,,,,,,,,,,,,,,,1/23/2016 19:45,1/23/2016 19:45,,,Block after Info Column,,,,,,,,,,,,,size=55 cm,0,0,1,0,0,1,1,1,0,1,1,,1,1,1,1,1,0,0,0,1,,,,,,,,,,,,"sku=shirt-black,color=Black|sku=shirt-red,color=Red",color=Color,

This CSV is working on other installations and is exactly as I had mine, but when I import it, it doesn't do it right. I tried to create a test configurable product in Magento with it's simple products, export them, and then import the CSV to see if the configurable product was working as intended but, again, it wasn't.

So, I came here to ask, am I doing something wrong? Is there something I am overlooking? I have been a week looking up and down, doing a lot of test, tweaking my script in case that was the problem but it seems that, no matter what I do, I can't get it right and it's really frustrating. Maybe the answer is really simple and dumb, but I can't see it right now, I guess this is because I am new to Magento and this is the first time I am working with CSV.

Thank you for the help!

Read Entire Article