Magento2: Importing configurable product with 2 selectable attributes fails

Created on 9 Oct 2016  路  10Comments  路  Source: magento/magento2

Operating System: Ubuntu 15.10
PHP 5.6.11-1ubuntu3.4 (cli)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
mysql Ver 14.14 Distrib 5.6.31, for debian-linux-gnu (x86_64) using EditLine wrapper
Magento 2.1.0 CE

Steps to reproduce

  1. Install Magento
  2. Create one configurable product with 2 attributes - color and size
  3. Create configurations (simple products)
  4. Check if configurable product OK (eg. displays correctly on frontend, like the image below:
    configurable
  5. Export product csv.
  6. Delete products.
  7. Import products.

    Expected result

  8. Configurable product should be as above with both swatches available.

    Actual result

  9. Only sizes are available as swatches...

ImportExport Fixed in 2.1.x Fixed in 2.2.x Fixed in 2.3.x Clear Description Confirmed Format is not valid Ready for Work bug report

Most helpful comment

Did a bit of testing on this it seems to me export doesn't work for "configurable_variations" field. Whenever I exported it only included the data for one of the configurable attributes. By manually fixing the data I got import to work.

The export I got (line breaks added for clarity)

sku=TEST-MULTI-CONFIG-1-Blue-Small,size=Small|
sku=TEST-MULTI-CONFIG-1-Blue-Medium,size=Medium|
sku=TEST-MULTI-CONFIG-1-Blue-Large,size=Large|
sku=TEST-MULTI-CONFIG-1-Orange-Small,size=Small|
sku=TEST-MULTI-CONFIG-1-Orange-Medium,size=Medium|
sku=TEST-MULTI-CONFIG-1-Orange-Large,size=Large

The export I wanted (line breaks added for clarity)

sku=TEST-MULTI-CONFIG-1-Blue-Small,color=Blue,size=Small|
sku=TEST-MULTI-CONFIG-1-Blue-Medium,color=Blue,size=Medium|
sku=TEST-MULTI-CONFIG-1-Blue-Large,color=Blue,size=Large|
sku=TEST-MULTI-CONFIG-1-Orange-Small,color=Orange,size=Small|
sku=TEST-MULTI-CONFIG-1-Orange-Medium,color=Orange,size=Medium|
sku=TEST-MULTI-CONFIG-1-Orange-Large,color=Orange,size=Large

All 10 comments

Additionally, my question is, how can you import such products?
Because I tried to export first, to get the correct csv structure, but it didn't work like that...

Hello,

I report the same problem on native Magento 2.1.2 when I try to export configurable product with 2 variations.

I manually edit the file to be able to import them.

@ps202 You can based on this value or refer to the documentation to build your import file

sku=example-Red-XS,size=XS,color=Red|sku=example-Red-S,size=S,color=Red|sku=example-Red-L,size=L,color=Red...............................

I will report this bug to the Magento EE support too.

Thanks,
Franck.

Any update on this?

@franckgarnier21 thanks, I have already done that, but it did not work. Did it work for you?

Hello,

@ps202 It works very well for me. The attribute and options should be created before.

Create another topic, I will try to help you. The problem here concerns the export and not the import process.

internal jira ticket - MAGETWO-59934

To my mind, the problem is in this file:

  • vendor/magento/module-configurable-import-export/Model/Export/RowCustomizer.php:26

Indeed, the variable $this->configurableData[$product->getId()] is replaced on each loop.

Thanks,

Did a bit of testing on this it seems to me export doesn't work for "configurable_variations" field. Whenever I exported it only included the data for one of the configurable attributes. By manually fixing the data I got import to work.

The export I got (line breaks added for clarity)

sku=TEST-MULTI-CONFIG-1-Blue-Small,size=Small|
sku=TEST-MULTI-CONFIG-1-Blue-Medium,size=Medium|
sku=TEST-MULTI-CONFIG-1-Blue-Large,size=Large|
sku=TEST-MULTI-CONFIG-1-Orange-Small,size=Small|
sku=TEST-MULTI-CONFIG-1-Orange-Medium,size=Medium|
sku=TEST-MULTI-CONFIG-1-Orange-Large,size=Large

The export I wanted (line breaks added for clarity)

sku=TEST-MULTI-CONFIG-1-Blue-Small,color=Blue,size=Small|
sku=TEST-MULTI-CONFIG-1-Blue-Medium,color=Blue,size=Medium|
sku=TEST-MULTI-CONFIG-1-Blue-Large,color=Blue,size=Large|
sku=TEST-MULTI-CONFIG-1-Orange-Small,color=Orange,size=Small|
sku=TEST-MULTI-CONFIG-1-Orange-Medium,color=Orange,size=Medium|
sku=TEST-MULTI-CONFIG-1-Orange-Large,color=Orange,size=Large

I face same problem on native Magento 2.1.3.

I post question on http://magento.stackexchange.com/ waiting for get answer to solve this issue.

Here is my question:
http://magento.stackexchange.com/questions/153524/magento-2-exported-file-format-doesnt-work-for-configurable-variations-field

@ps202, thank you for your report.
The issue is already fixed in develop branch, 2.2.0, 2.1.9

Was this page helpful?
0 / 5 - 0 ratings