magento-engcom / import-export-improvements

Open Software License 3.0
31 stars 29 forks source link

Configurable products import doesn't work configurable_variations not imported #90

Open piotrekkaminski opened 6 years ago

piotrekkaminski commented 6 years ago

From @akamura on July 28, 2016 20:16

Preconditions

  1. PHP 7.0.6
  2. MySQL CE 5.6.30
  3. Magento 2.1.0

    Steps to reproduce

Create a CSV with 3 virtual products and one configurable product. The only attribute configurable is COLOR. Add to the CSV (screenshot attached) the additional_attributes field, as well as configurable_variations and configurable_variation_lables.

Expected result

The import procedure should create three virtual products and one configurable and using the configurable_variations and configurable_variation_labels connect the three virtual products to the configurable one.

Actual result

Imported file: screen shot 2016-07-28 at 22 09 38

Exported file: As you can see Magento ignore both configurable_variations and configurable_variation_labels fields making the import successful but configurable products fail. screen shot 2016-07-28 at 22 14 44

Copied from original issue: magento/magento2#5876

piotrekkaminski commented 6 years ago

From @akamura on August 3, 2016 9:40

Even in Magento official guide I haven't found anything related to configurable_variations or configurable_variation_labels

http://docs.magento.com/m2/ce/user_guide/system/data-attributes-product.html

This is very strange since if you create and configure a configurable product from the backend and then you export the CSV file those two fields have data inside.

I even did the following test:

  1. Create a product configurable (3 virtual products, 1 configurable)
  2. Save and export the CSV file
  3. Delete the product created
  4. Without editing the CSV file exported just reimport it
  5. Magento create 3 virtual product and 1 configurable correctly but it didn't recognize the configurable_variations fields so the configurable product basically doesn't have any relation with the three virtual resulting in an empty product.
piotrekkaminski commented 6 years ago

From @AzVo on August 18, 2016 15:54

Hi

Thank you for your request, but unfortunately I can't reproduce this issue. I have CE 2.1.0 and one configurable product with 2 virtual products which were successfully exported and reimported. You can check my sample .csv file in attached .zip archive. Could you try to import it? And don't forget to reindex your indexes to have last data (http://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-index.html#config-cli-subcommands-index-reindex)

Probably error can occured only with some specific data, so could you help me and provide detailed steps to reproduce the same situation as on your server? I will appreciate it!

Thanks! I am looking forward to getting response from you.

sample.zip

piotrekkaminski commented 6 years ago

From @akamura on August 26, 2016 9:22

Hi, import was successful but there is still a problem.

After import I navigate to the category where the configurable product is supposed to be, and the category is empty. So I search for product SKU "CPr" and result is product not found.

I login to the backend and search for "CPr" as you can see Configuration is empty. If I manually create the configuration then the configurable product appear correctly on the frontend. screen shot 2016-08-26 at 11 13 59

I tried with my CSV file also and the result is the same.

I'm running Magento 2.1.0

Thanks Marcos

piotrekkaminski commented 6 years ago

From @AzVo on August 26, 2016 9:56

Hi, Have you tried to rebuild your indexes after import? You can find information about them in Admin-System-Tools-Index Management And to rebuild index you need to use this command in cli php bin/magento indexer:reindex

piotrekkaminski commented 6 years ago

From @akamura on August 26, 2016 15:56

Hi AzVo, yes I executed the rebuild from the commandline but the product is still misconfigured.

I attach you my file that I have edited since I have different attribute_set and websites code. catalog_product_20160818_143015 2.csv.zip

Thanks Marcos

piotrekkaminski commented 6 years ago

From @akamura on September 2, 2016 17:52

@AzVo did you tried with my file?

Thanks Marcos

piotrekkaminski commented 6 years ago

From @AzVo on September 5, 2016 13:16

Hi @akamura ,

I am in progress with your issue. I found that "problem" is in store_view_code field. If it is empty - products are successfully imported with configurable options. But if there is any value - it fails. I need some more time to discuss this with my colleagues.

piotrekkaminski commented 6 years ago

From @AzVo on September 9, 2016 8:24

Hi again

I have created internal ticket for this bug (#MAGETWO-58213) to fix it. This issue will be closed after fix.

Thanks for help!

piotrekkaminski commented 6 years ago

From @akamura on September 9, 2016 17:13

@AzVo thank you very much

piotrekkaminski commented 6 years ago

From @alexnos88 on September 20, 2016 17:28

Having the same problem. Will be glad to see the fix))

piotrekkaminski commented 6 years ago

From @Yonn-Trimoreau on September 27, 2016 13:42

For those who find this issue and can't import configurables properly even with store_view_code not set, here is how I solved the issue:

The field 'configurable_variations' must be formated like this:

"sku=xxx##color=black|sku=yyy##color=yellow"

Where ## is your multiple value separator

Here is the corresponding code

piotrekkaminski commented 6 years ago

From @erik-augustin on September 28, 2016 7:20

when i export configurable item with multiple text swatches only one text swatch is exported(at field configurable_variations)

piotrekkaminski commented 6 years ago

From @sshymko on November 7, 2016 21:3

Having the same (or similar) problem: relations to simple products won't import for configurable product when store view is specified in the CSV file.

@AzVo Any updates on the core fix?

piotrekkaminski commented 6 years ago

From @LiamFielding on November 30, 2016 14:54

Try the import and turn down errors to one - it is usually my fault when this happens.

piotrekkaminski commented 6 years ago

From @jarnail104 on December 27, 2016 12:46

If anyone imported configurable product with color and size or more attributes , please send file here. i am having this issue. thank you

piotrekkaminski commented 6 years ago

From @jarnail104 on December 28, 2016 7:21

@Yonn-Trimoreau ...I need to import configurable products with color and size attributes and thats not working. Can you please help me or you can send me demo file which work on 2.1.2. I can also upgrade my version to 2.1.3 i am not sure if this issue is fixed because i didnt find anything related to importing configurable product. Thanks

piotrekkaminski commented 6 years ago

From @Yonn-Trimoreau on January 6, 2017 11:4

Sorry @jarnail104, I don't have the import file neither the project anymore..

Try with 'configurable_variations' row formatted like this :

"sku=xxx##color=black##size=37|sku=yyy##color=yellow##size=38"

And set your multiple value separator to "##".

If you can't manage to make it work, send us a stack trace or an error code, or maybe your file and some details about how that's not working.

Good luck

piotrekkaminski commented 6 years ago

From @fmd-sav on February 1, 2017 12:43

Hello guys,

I had the same problem in Magento 2.1.3 and solved it for me.

I had to add the attributes in configurable_variations also in the additional_attributes field. After that Magento recognize the connection between the configurable and simple product.

Good luck.

piotrekkaminski commented 6 years ago

From @JosueTorresM on March 8, 2017 16:4

Hello guys,

Hi @fmd-sav I tried to add the key fields in the additional_attributes but it does not work :(

This how looks my configurable_variations: sku=MX_2303024_31,size=25|sku=MX_2303024_32,size=25.5

How can I add these keys to the additional_attributes?, only for the configurable product? or for every simple product?

Thx a lot

piotrekkaminski commented 6 years ago

From @iacopop on April 13, 2017 13:37

Hi, is there a simple_file.csv that can be used as test to import a configurable product with size and color variations?

I'm not able to import it in magento 2.1.6 thanks Iacopo

piotrekkaminski commented 6 years ago

From @LiamFielding on April 13, 2017 14:51

Create one in the interface and export a csv - it will show you exactly how it is done.

piotrekkaminski commented 6 years ago

From @sonjaka on May 9, 2017 8:38

I have this problem also - configurable products are imported correctly when "store_view_code" is empty, but as soon as I set it, the products are not correctly associated anymore. Import still works, just the connection between the products somehow doesn't work out.

Is there a solution that I missed? I need to import products for three different store views and any help would be greatly appreciated.

piotrekkaminski commented 6 years ago

From @iacopop on May 9, 2017 9:33

i try to import standard product in single website/storeview configuration. Import works if file csv is exported from magento2 with all fields. I hope it can help you.

Iacopo

2017-05-09 10:38 GMT+02:00 Sonja notifications@github.com:

I have this problem also - configurable products are imported correctly when "store_view_code" is empty, but as soon as I set it, the products are not correctly associated anymore. Import still works, just the connection between the products somehow doesn't work out.

Is there a solution that I missed? I need to import products for three different store views and any help would be greatly appreciated.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/5876#issuecomment-300099181, or mute the thread https://github.com/notifications/unsubscribe-auth/AAuE7U1B7VFkYnKW6xaYW90f_ycSegSVks5r4CYbgaJpZM4JXmVy .

-- Iacopo Pecchi E-commerce Specialist & Project Manager http://www.consulente-ecommerce.it tel. +39 328 9381301 info@consulente-ecommerce.it P.IVA: 02084840517 skype: iacopopecchi

piotrekkaminski commented 6 years ago

From @Sapta34 on June 13, 2017 6:48

I want to import the attach CSV file to magento 2.0.10. I have successfully import this csv, but the options for the configurable product not display in frontend. Alreday reindex and clear cache. catalog_product_20170605_101740.zip

piotrekkaminski commented 6 years ago

From @magento-engcom-team on October 10, 2017 15:30

@akamura, thank you for your report. We've created internal ticket(s) MAGETWO-58213 to track progress on the issue.

piotrekkaminski commented 6 years ago

From @jigar48 on November 4, 2017 15:8

Any Update on this issue

simonmaass commented 6 years ago

+1 I am having the same problem!

tadhgbowe commented 6 years ago

Hello @simonmaass. I'm reviewing all the past history/comments on this.

Are you still having problems?

I've been doing extensive testing on configurable product importing. I'm trying to identify what are the outstanding issues (if any) from all previous comments. I appreciate many of these comments go back in time.

I downloaded the zip file that @Sapta34 (see further up) and I was able to import this fine in v2.2.2 except for row 15 which didn't look quite complete. After importing I did a command reindex (in dev environment with no cron running) and it all showed up fine on the frontend. Note: Before I ran the import I needed to make sure my size and color attributes had all the necessary option values. They must exist first.

If you are importing a new configurable product you can't have a store_view_code specified. You will probably receive an error message like this:

The configurable_variations column is quite interesting. In the example below we have the contents of that column from the example download above.

sku=111040C252-Creme-34,size=34,color=Creme|sku=111040C252-Creme-36,size=36,color=Creme|sku=111040C252-Creme-38,size=38,color=Creme|sku=111040C252-Creme-40,size=40,color=Creme|sku=111040C252-Creme-42,size=42,color=Creme|sku=111040C252-Creme-44,size=44,color=Creme|sku=111040C252-Rosa-34,size=34,color=Rosa|sku=111040C252-Rosa-36,size=36,color=Rosa|sku=111040C252-Rosa-38,size=38,color=Rosa|sku=111040C252-Rosa-40,size=40,color=Rosa|sku=111040C252-Rosa-42,size=42,color=Rosa|sku=111040C252-Rosa-44,size=44,color=Rosa

As you can see it's quite a tricky column to get right. Many clients struggle to get their import data correct. I made this discovery last week which may help:

*** You don't need to specify any super attribute values. You just need to tell the import what super attribute codes each SKU is linked to. Here's the revised column:

sku=111040C252-Creme-34,size=,color=|sku=111040C252-Creme-36,size=,color=|sku=111040C252-Creme-38,size=,color=|sku=111040C252-Creme-40,size=,color=|sku=111040C252-Creme-42,size=,color=|sku=111040C252-Creme-44,size=,color=|sku=111040C252-Rosa-34,size=,color=|sku=111040C252-Rosa-36,size=,color=|sku=111040C252-Rosa-38,size=,color=|sku=111040C252-Rosa-40,size=,color=|sku=111040C252-Rosa-42,size=,color=|sku=111040C252-Rosa-44,size=,color=

The above virtual/simple SKUs must have a valid size and color already set. Otherwise it will not save that variation.

Please send on any remaining issues. Happy to help.

Thanks, Tadhg

simonmaass commented 6 years ago

Hello Tadhg,

thank you for your detailed testing and effort - that you can import without the specific attribute value in the child product colum is very cool.

I decided to go with an extention: https://firebearstudio.com/the-improved-import.html

The thing that sold it for me was that you could specify the child products from a configurable product via a single colum in the sheet. This makes it much more easy....

At the moment i was able to import about 100k products... from that were about 50 configurbale products with child products rangeing from 6k to 15k...

Best Regards Simon

tadhgbowe commented 6 years ago

Hi @simonmaass

Thanks for the update. An improvement for Magento 2 would be to match what that extension does.

Instead of having the current configurable_variations column we would have two columns: configurable_variation_skus - comma separated list of SKUs configurable_super_attributes - comma separated list of super attribute codes.

The product export would also need to be updated to line up with the above changes.

Our experience has shown that clients really struggle with the configurable_variations column. There's too much happening in there.

Thanks and regards, Tadhg

jackeryhammond commented 6 years ago

Hi

I thought it would be worth noting, I am having this issue occur only when the attribute that the configurations revolve around were created by myself.

I ensured the attribute was created based off the guidelines provided for configurable products in the Magento Documentation.

I've followed all applicable steps provided by people in this thread.

If I do this based off of colour it is absolutely fine. Weird...

tkymuk commented 5 years ago

Does anyone have a working fix for this? I've created a configurable product with 4 simples, downloaded the product info and then re-uploaded without changing anything and the simples are not linked to the configurable.

The ormating suggested above is as is, store view has no data in the cells but the issue is still there.

curkle commented 5 years ago

Please verify the product is configurable , magneto 2 will auto convert configurable to simple if there is no associate products when you save the product

using query to update the catalog_product_entity table and set type_id = 'configurable' to fix this issue