magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Magento 2 Product Import - Unable to create Attribute values dynamically. #18382

Closed Dan547 closed 5 years ago

Dan547 commented 5 years ago

Preconditions

  1. Magento 2.2.5.
  2. Product Importer
  3. Adding new products

Steps to reproduce

  1. Create a custom dropdown attribute with no values assigned
  2. Assign new attribute to attribute group
  3. In your import sheet, add that attribute to the custom_attributes column with a value you desire
  4. Import that sheet into the Magento Product Importer.

Expected result

  1. Generate Attribute Value if it does not already exist

Actual result

  1. Following error will appear = Value for 'attribute' attribute contains incorrect value, see acceptable values on settings specified for Admin.
  2. Import does not continue

This is very frustrating because we have over 30,000 products that all have similar and different values for the custom Attributes. Manually having to enter these values is a mammoth task that will takes days if not weeks to do.

magento-engcom-team commented 5 years ago

Hi @Dan547. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop). For more details, please, review the Magento Contributor Assistant documentation.

@Dan547 do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

Dan547 commented 5 years ago

@magento-engcom-team give me 2.2.5 instance

magento-engcom-team commented 5 years ago

Hi @Dan547. Thank you for your request. I'm working on Magento 2.2.5 instance for you

magento-engcom-team commented 5 years ago

Hi @Dan547, here is your Magento instance. Admin access: https://i-18382-2-2-5.engcom.dev.magento.com/admin Login: admin Password: 123123q Instance will be terminated in up to 3 hours.

Dan547 commented 5 years ago

Can confirm issue is reproduced on vanilla Magento instance following steps above.

magento-engcom-team commented 5 years ago

Hi @engcom-backlog-nazar. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

ghost commented 5 years ago

Hi @Dan547 i'm no able to reproduce following steps you described, please verify that type of attribute you created have correct value. e.g text have "text" e.g int have 1,2,3.

joshdavenport commented 4 years ago

@magento-engcom-team give me 2.3.5 instance

magento-engcom-team commented 4 years ago

Hi @joshdavenport. Thank you for your request. I'm working on Magento 2.3.5 instance for you

magento-engcom-team commented 4 years ago

Hi @joshdavenport, here is your Magento instance. Admin access: https://i-18382-2-3-5.instances.magento-community.engineering/admin_13a6 Login: 99142256 Password: bfbace26e9c4 Instance will be terminated in up to 3 hours.

joshdavenport commented 4 years ago

Just checked this in the 2.3.5 instance.

The validation step catches that your import is trying to import an attribute value that doesn't exist. From that perspective there is no issue.

From the perspective of users doing large imports with attributes that have values that don't already exist in the system, there is absolutely a huge issue here. In other words, OPs original report is saying that this behaviour shouldn't be how this works. The import should create the attribute values on the fly as it is often the case that there are 100s or 1000s of new values in an import. It is an extreme burden to have to add these values in by hand before doing the import.

Steps to follow:

  1. Added color attribute to Default attribute set
  2. Downloaded sample sheet
  3. Reduced to one row (product sku 24-WG085 which uses Default attribute set)
  4. Add color value to additional_attributes. I appended color=New Color (with a comma of course)
  5. Go to Import. Entity Type: Products, Import Behaviour: Add/Update
  6. Proceed to "Check data"

Result:

Screenshot 2020-07-08 at 12 48 38

Here's what I imported with:

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,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,deferred_stock_update,use_config_deferred_stock_update,related_skus,crosssell_skus,upsell_skus,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,associated_skus
24-WG085,,Default,simple,"Default Category/Gear,Default Category/Gear/Fitness Equipment",base,Sprite Yoga Strap 6 foot,"<p>The Sprite Yoga Strap is your untiring partner in demanding stretches, holds and alignment routines. The strap's 100% organic cotton fabric is woven tightly to form a soft, textured yet non-slip surface. The plastic clasp buckle is easily adjustable, lightweight and urable under strain.</p><ul><li>100% soft and durable cotton.<li>Plastic cinch buckle is easy to use.<li>Three natural colors made from phthalate and heavy metal free dyes.</ul>",,1.23,1,Taxable Goods,"Catalog, Search",14,,,,sprite-yoga-strap-6-foot,Meta Title,"meta1, meta2, meta3",meta description,2015-10-25 3:34:20,2015-10-25 3:34:20,,,Block after Info Column,,,,,,,,,,,Use config,,"has_options=1,quantity_and_stock_status=In Stock,required_options=0,color=New Color",100,0,1,0,0,1,1,0,0,1,1,,1,0,1,1,0,1,0,0,1,0,1,"24-WG087,24-WG086","24-WG087,24-WG086","24-WG087,24-WG086",,"name=Custom Yoga Option,type=drop_down,required=0,price=10.0000,price_type=fixed,sku=,option_title=Gold|name=Custom Yoga Option,type=drop_down,required=0,price=10.0000,price_type=fixed,sku=,option_title=Silver|name=Custom Yoga Option,type=drop_down,required=0,price=10.0000,price_type=fixed,sku=yoga3sku,option_title=Platinum",,,,,,
meer-online commented 3 years ago

@joshdavenport @Dan547 Is this issue fixed? I still can reproduce this with 2.4 version with the above mentioned steps.

joshdavenport commented 3 years ago

Not done any large import yet in 2.4 but wouldn't be surprised if the issue is still present. Given the lack of recognition this issue received, it's apparently a niche issue. Doesn't feel like that when you have to deal with the repercussions unfortunately!

I believe we ultimately had to pull apart our import, compare attribute options in the spreadsheet to options grabbed from the database, and create any that were missing.