You should follow below steps:
- Create the simple product rows
- Create configurable product row
- Assign child products to the configurable product
Below is the very basic csv sample;
sku,_store,_attribute_set,_type,_category,_root_category,_product_websites,color,cost,description,meta_keyword,name,price,short_description,size,_super_products_sku,_super_attribute_code,_super_attribute_option,_super_attribute_price_corr
F0000077.03,default,Default,simple,High Heels,Default Category,base,Black,10.99,Product description,"New in, heels, heeled sandals",Product name,25,Product Shot description here,3,,,,
F0000077.04,default,Default,simple,High Heels,Default Category,base,Black,10.99,Product description,"New in, heels, heeled sandals",Product name,25,Product Shot description here,4,,,,
F0000077.05,default,Default,simple,High Heels,Default Category,base,Black,10.99,Product description,"New in, heels, heeled sandals",Product name,25,Product Shot description here,5,,,,
F0000077.06,default,Default,simple,High Heels,Default Category,base,Black,10.99,Product description,"New in, heels, heeled sandals",Product name,25,Product Shot description here,6,,,,
F0000077.07,default,Default,simple,High Heels,Default Category,base,Black,10.99,Product description,"New in, heels, heeled sandals",Product name,25,Product Shot description here,7,,,,
F0000077.08,default,Default,simple,High Heels,Default Category,base,Black,10.99,Product description,"New in, heels, heeled sandals",Product name,25,Product Shot description here,8,,,,
F0000077,default,Default,configurable,New In,Default Category,base,Black,10.99,Product description,"New in, heels, heeled sandals",Product name,25,Product Shot description here,,F0000077.03,size,3,0
,,,,High Heels,Default Category,,,,,,,,,,F0000077.04,size,4,0
,,,,High Heels/Heeled Sandals,Default Category,,,,,,,,,,F0000077.05,size,5,0
,,,,High Heels/Strappy Heels,Default Category,,,,,,,,,,F0000077.06,size,6,0
,,,,Sandals,Default Category,,,,,,,,,,F0000077.07,size,7,0
,,,,High Heels,Default Category,,,,,,,,,,F0000077.08,size,8,0
Best Answer
We've experienced the same issue, it seems import module has some kind of bug with related products
We've solved it by writing a new console command which expects a 2 columns (parent sku & children skus) related.csv file in var folder, with comma as csv separator, and pipe as children_skus separator
This are the files, if you want to try. You'd replace Sinapsis with your desired vendor name, and Sync with your desired module name
After installing the module, run
bin/magento setup:upgrade
& you'll see the new command if you checkbin/magento list
, which could be executed by runningbin/magento sync:related
update
Since 2.2.* version, there are 2 changes required: an extra line before saving
$product
, to prevent issue reported here https://github.com/magento/magento2/issues/10687And changing admin to adminhtml in
I think first change is innocuous for older versions, not the same for the second. So I have added only the first in below code
app / code / Sinapsis / Sync / etc / di.xml
app / code / Sinapsis / Sync / etc / module.xml
app / code / Sinapsis / Sync / registration.php
app / code / Sinapsis / Sync / Console / Command / RelatedCommand.php