• I’m trying to do a product import where the ‘Attribute 1 value(s)’ field in my CSV file contains CRLFs. The CSV file is not made in Excel.

    However, after the products have been imported, the CRLFs have been removed. Is this intended? The preview of the import (the field mapping step prior to the actual import) shows the content of the ‘Attribute 1 value(s)’ field WITH the CRLFs.

    Another way to illustrate this is, if I go to the Woocommerce plugin and manually create a product with CRLFs in the ‘Attribute 1 value(s)’ field and then export this product, the CSV file does contain CRLFs. However, if I then delete the product and import the exported CSV file, the CRLFs are lost.

    I would expect CRLFs to be imported as well, just like the ones contained in the ‘Description’ field.

    Is this a bug in the import function or am I doing something wrong?

    Thanks in advance for any feedback.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Remi Corson

    (@corsonr)

    Automattic Happiness Engineer

    Hey,

    I’d suggest you have a look at this document: https://github.com/woocommerce/woocommerce/blob/master/sample-data/sample_products.csv

    It’s a CSV sample file to teach out to define attributes. I’d used it as a reference.

    Also, please make sure you follow the guidelines listed here:

    https://docs.woocommerce.com/document/product-csv-importer-exporter/

    Thread Starter ljstilling

    (@ljstilling)

    Hi, Remi

    Thanks for the links to information on how to do product imports, which I had already followed.

    What I’m describing here is a bug. Are you able to reproduce it based on my description? If not, please let me know and I will be happy to provide further instructions.

    Remi Corson

    (@corsonr)

    Automattic Happiness Engineer

    Hi there,

    Can you please provide a step by step guide to replicate, I’ll be happy to test and log an issue if needed.

    Thread Starter ljstilling

    (@ljstilling)

    Alright, Remi, here are the steps to follow in order to reproduce the issue about CRLFs not being imported.

    1. For the sake of convenience start with a database empty of products.
    2. Being the proces of adding a new product from the WP admin dashboard.
    3. Give the product a random name and click on ‘Attributes’
    4. Click the add button and enter a random name for the attribute.
    5. In the ‘Value(s)’ field enter 3 random lines of text separated by CRLFs and click ‘Save Attributes’.
    6. Click the ‘Publish’ button and then the ‘View product’ link.
    7. Notice under ‘Additional information’ for the product you just created, that the text you entered for the attributes is indeed shown as 3 lines of text.
    8. Now go back to the ‘All products’ list and click the ‘Export’ button and subsequently the ‘Generate CSV’ button. Save the actual CSV file on your hard drive.
    9. Go back the ‘All products’ list and delete the product you just created.
    10. Click the ‘Import’ button, select the CSV file you just created and click ‘Continue’
    11. On the ‘Column mapping’ page scroll down to the ‘Attribute 1’ field. Notice that the sample text shows the 3 lines you entered, separated by CRLFs.
    12. Click the ‘Run the importer’ button.
    13. Click on the ‘Show products’ button and view the product you just imported.
    14. Notice that the text from the ‘Attribute 1’ field is now shown as one line instead of 3. In other words, the CRLFs have been ignored from the string. I would expect the text to be shown as 3 lines.

    That was it. Thanks for your attention to this matter ??

    Kind regards,
    Lasse

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CRLFs are not imported for the ‘Attribute 1 value(s)’ field’ is closed to new replies.