Magento2: IMPORT: additional_attributes are completely ignored in 2.2.3

Created on 27 Apr 2018  路  24Comments  路  Source: magento/magento2

Preconditions

Magento 2.2.3 (on multiple installations with different prerequisites)

Steps to reproduce

Import CSV like this (i reduced it to mandatory stuff, it does not work in any variation i tried with other columns present):

sku,price,attribute_set_code,product_type,name,additional_attributes
913350,1,Default,simple,Loses Vollgummi-Rad mit Kunstofffelge,"basenbestaendig=Ja,bodenschonend=Ja,featured=0,felgenmaterial=Kunststoff,geraeuscharm=Ja,haerte=83 卤 4,hitzbestaendig=Nein,kohlenwasserstoffbestaendig=Nein,korriosionsbestaendig=Nein,lagerart=Gleitlager,modell=KBN,nabenbohrung_durchmesser=12,oelbestaendig=Nein,radmaterial=Gummi,rad_breite=25,rad_durchmesser=80,saeurebestaendig=Ja,salzloesungen=Ja,temp_max=60,temp_min=-10,tragkraft=50,verwendung=leichte und mittelschwere Transportger盲te bis 4 km/h"
917257,1,Default,simple,Vollgummi-Bockrolle mit Kunststofffelge,"basenbestaendig=Ja,bauhoehe=108,bodenschonend=Ja,felgenmaterial=Kunststoff,gehaeuse=Stahlblech, gepresst, verzinkt,geraeuscharm=Ja,haerte=83 卤 4,hitzbestaendig=Nein,kohlenwasserstoffbestaendig=Nein,korriosionsbestaendig=Nein,lagerart=Gleitlager,modell=KBN,oelbestaendig=Nein,plattengroesze_breite=85,plattengroesze_laenge=105,radmaterial=Gummi,rad_breite=25,rad_durchmesser=80,saeurebestaendig=Ja,salzloesungen=Ja,schraubloch_durchmesser=9,schraubloch_entfernung_laenge=80,temp_max=60,temp_min=-10,tragkraft=50,verwendung=leichte und mittelschwere Transportger盲te bis 4 km/h"

I created this with Magento Export on one installation, tried to import it to the same magento installation on another server and do not want to recreate hundrets of custom attributes every time.

Expected result

Additional attributes are created

Actual result

Creates products with no error but without any created custom attribute.

CatalogImportExport Confirmed P2 ready for dev Reproduced on 2.1.x Reproduced on 2.2.x Reproduced on 2.3.x S2

Most helpful comment

2.3.5-p1 imported 15k products, then realized no additional attributes... nice

All 24 comments

@einicher, thank you for your report.
We've acknowledged the issue and added to our backlog.

has this been resolved?

i'm having the same issue. i tested 2.1.3 and it worked, upgraded to 2.2.1 and it stopped working. tried in fresh install of 2.3.1 and it is not working. even tried to export the csv, delete the product, and import the csv, but was still ignored.

I can confirm the same issue occurs on 2.2.9. Is this something that is being addressed?

Thanks.

Same on 2.3.2

FFS... Seriously, one and a half year later and still not working...

On 2.3 at the moment. If the attribute field is a dropdown or multi-select, the fields need to be manually added into the system before it will be recognised. Insane.

On 2.3 at the moment. If the attribute field is a dropdown or multi-select, the fields need to be manually added into the system before it will be recognised. Insane.

yep. i have hundreds of attributes for my store. tried importing them in sql, which works, but the import process for the csv still ignores them.

On 2.3 at the moment. If the attribute field is a dropdown or multi-select, the fields need to be manually added into the system before it will be recognised. Insane.

yep. i have hundreds of attributes for my store. tried importing them in sql, which works, but the import process for the csv still ignores them.

From memory, the attributes sit in two different tables, one has the value and an ID, and they other has an ID and some other ID. Does your sql insert take that into consideration?

On 2.3 at the moment. If the attribute field is a dropdown or multi-select, the fields need to be manually added into the system before it will be recognised. Insane.

yep. i have hundreds of attributes for my store. tried importing them in sql, which works, but the import process for the csv still ignores them.

From memory, the attributes sit in two different tables, one has the value and an ID, and they other has an ID and some other ID. Does your sql insert take that into consideration?

I can recommend using https://github.com/bigbridge-nl/product-import. It took me a day to get the Magento import working, only to find out it didn't do anything with the attributes... I converted the CSVs I had to XMLs, and within an hour I had all my data imported. Saves you a lot of hassle of inserting in the right tables...

From memory, the attributes sit in two different tables, one has the value and an ID, and they other has an ID and some other ID. Does your sql insert take that into consideration?

i believe so. honestly, it's been so long i gave up on this working. IIRC, i inserted them into eav_attribute, eav_attribute_option, and eav_attribute_option_value. i dont have the code handy, must have gotten pissed it didnt work and not save it.

I can recommend using https://github.com/bigbridge-nl/product-import. It took me a day to get the Magento import working, only to find out it didn't do anything with the attributes... I converted the CSVs I had to XMLs, and within an hour I had all my data imported. Saves you a lot of hassle of inserting in the right tables...

i will try this. thanks!

still on 2.3.3
I got into this problem yesterday for the first time.
So from my side this is a +1

Still on 2.3.4. Just bumped into the issue today.

This is still an issue on version 2.3.5 p1. is there a fix we can do directly on our installation or something??

2.3.5-p1 imported 15k products, then realized no additional attributes... nice

I managed yesterday to create an import profile that actually worked by changing the multiple value separator to ~ because I was certain no attribute was using it and also unchecked the enclosure. I was able to import successfully the attributes. Could you guys give it a shot like that?

Of course that means modifying the values in the column too

@ioweb-gr noup, i doesn't work with my file.... my test file looks like this and doesn't work. only "Aplicaciones" is a multiselect, all others are just text
sku,additional_attributes 223995901,"Tipo_de_producto=Sensor de presi贸n,Marca=FRANKLIN,Serie=Sensor SubDrive,Aplicaciones=Comercio~Agricultura~Industria,Garantia=1 a帽o" 225495901,"Tipo_de_producto=Sensor de presi贸n,Marca=FRANKLIN,Serie=Sensor SubDrive,Aplicaciones=Comercio~Agricultura~Industria,Garantia=1 a帽o"

is there any patch or clue or hint?
im really dont have time to debug this :(

I couldn't source a viable long term solution, but I found my quick and dirty fix here - https://magento.stackexchange.com/questions/103934/magento2-programmatically-add-product-attribute-options. I used the last solution which also has a negative score. But damnit, it got the job done at the time.

No matter what kind of separator U use CSV import is not working for me tested on fresh install PHP7.1/7.2 with new products manually added and imported demo store... I even exported 1 product from Magento demo store and imported it again and attributes are missing. I've tested even simple text attribute and this is not imported as well... I've wasted so much time for this...
I made also tests with one attribute and one value... not working. All attribute values where created earlier in admin... (Magento 2.3.x). Attributes are basic feature for e-commerce and product segmentation. What a shame it;s not working as expected.

additional_attributes doesn't work in magento 2.3.5-p1 but it works if I put all the custom attributes as columns, but not via "additional_attributes" field. Please check and provide some fix.

Anyone reading this, don't tick the box "Fields enclosure" - leave that unchecked. In my tests, when checking that box, importing additional_attributes would not work

Anyone reading this, don't tick the box "Fields enclosure" - leave that unchecked. In my tests, when checking that box, importing additional_attributes would not work

Wow - something that simple resolved the issue for me. Although with my set of data, which includes commas and quotes within HTML of some fields, I'm not 100% sure of the purpose of "Field Enclosure" now.

additional_attributes doesn't work in magento 2.3.5-p1 but it works if I put all the custom attributes as columns, but not via "additional_attributes" field. Please check and provide some fix.

i was able to get them imported using this method after using sql (below) to import my attributes.

From memory, the attributes sit in two different tables, one has the value and an ID, and they other has an ID and some other ID. Does your sql insert take that into consideration?

i recently had to import them again, so i took notes of the sql used:

INSERT INTO eav_attribute VALUES (attribute_id | entity_type_id | attribute_code | attribute_model | backend_model | backend_type | backend_table | frontend_model | frontend_input | frontend_label | frontend_class | source_model | is_required | is_user_defined | default_value | is_unique | NULL);

INSERT INTO eav_attribute_option_value VALUES (value_id | option_id | store_id | value | );

INSERT INTO eav_attribute_option VALUES (option_id | attribute_id | sort_order | );

INSERT INTO catalog_eav_attribute VALUES (attribute_id | frontend_input_renderer | is_global | is_visible | is_searchable | is_filterable | is_comparable | is_visible_on_front | is_html_allowed_on_front | is_used_for_price_rules | is_filterable_in_search | used_in_product_listing | used_for_sort_by | is_configurable | apply_to | is_visible_in_advanced_search | position | is_wysiwyg_enabled | is_used_for_promo_rules | is_required_in_admin_store | is_used_in_grid | is_visible_in_grid | is_filterable_in_grid | search_weight | additional_data | );

i used excel to fill in all of the data. it's dirty, but works. obviously you'll have to replace the column names with the actual values you want to insert.

2.4.1 - additional attributes not imported, in any way 馃憤

Had same issue with clean install of Magento 2.4.1. What i found fixed my problem was when a new attribute was created the default value in the eav_attribute dafault_value cell was blank. Once i changed the cell to 'null' the import of addtional_attributes via csv file worked flawless.

Rich

Was this page helpful?
0 / 5 - 0 ratings