Magento – Magento 2 csv import : How to escape commas in additional_info

attributescsvcustom-attributesimportmagento2

I am importing products via .csv import. I have an additional_attribute field that contains commas. Commas are the delimiter within additional_attributes, and when i try to import my products, all of the additional attribute fields that contains commas get cut off after the first comma. How can i prevent this?

I defaulted to adding a product with a comma in the additional attribute field through the admin and exported it. It looked normal, as shown below at "the battlefield, draw". But if i try to import that same .csv file the text will be cut off after "battlefield"
I tried a forward slash(backslash?) to no avail. I even surrounded the text in double-quotes for the import… no dice…

    color=White,magic_card_number=125,magic_cmc=4,magic_expansion=Alliances,magic_flavor_text=<p>coming soon</p>,magic_power=1,magic_rarity=Common,magic_rules_text=<p>Flying</p>
<p>When Carrier Pigeons enters the battlefield, draw a card at the beginning of the next turn's upkeep.</p>,magic_toughness=1,magic_type=Creature,manufacturer=Wizards of the Coast

Best Answer

You don't need to modify any code or your import file (as provide above) to get this to work.

You can change the separator used for the 'additional_attributes' column by changing the value for the 'Multiple value separator' on the product import screen in the admin area to something other than a comma (see image below).

Product import multi value separator

Please note I tested this using Magento CE 2.0.7, adding an attribute called 'magic_rules_text' and adding the same content in your original question.

I initially had the same issue when the value for 'Multiple value separator' was left at ','. I changed this to ';' and the full content imported to the attribute correctly.

Related Topic