0

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
  • I changed the DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR in \vendor\magento\module-import-export\Model\Import.php to ^ and still when i import an additional_info field w/ commas it cuts off after the first comma. – Bullseye May 24 '16 at 20:17
  • UPDATE: just checked the table importexport_importdata after the above change. The full text is in that table, but in catalog_product_entity_text it is still cut off at the first comma. Maybe import works, but the db write is flawed? HELP! – Bullseye May 24 '16 at 20:50
2

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.

  • 2
    Yeah but then how do you change the seperator in the csv? – Stevie G Feb 28 '17 at 11:07
  • 1
    @StevieG don't use Excel. In any other spreadsheet programm you can set the separator. – Johnny Longneck Feb 5 '18 at 13:01
0

Don't confuse it with the editor you're using to open CSV file. That is the main culprit. I opened my CSV in simple text-editor and below hack worked for me.

CSV file content

sku|additional_attributes|updated_at 01|tab_highlights=a,b,c$#$tab_custom=CUSTOM$#$tab_deliveryscope=a,b,c|12/20/18

Explanation: I separated my fields with vertical bar(|) and for multiple values in single column i used custom separator that is highlighted in above content $#$ used to separate the multiple values of second column ( additional_attributes )

Import Setting on Magento Dashboard

 Dashboard Import Setting

Helped taken from this article : Guide to Import Magento2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.