• Resolved simlock

    (@simlock)


    Hello,

    I don’t understand the interest of the step “Map CSV fields to products” when importing a CSV file.

    Let’s say I export my products in a CSV file via the same tool but in the CSV file I change the name of the fields concerning the attributes.
    When I import my new CSV file, the import tool doesn’t map automatically anymore but even if I force the fields on “Attribute name”, “Attribute value(s)”, etc, the import still doesn’t work concerning the attributes so I don’t understand its role.

    Could someone explain me what WooCommerce does in this step?

    Thanks !

Viewing 5 replies - 1 through 5 (of 5 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi @simlock,

    When importing products WooCommerce automatically attempts to match or “map” the Column Name from your CSV to Fields. If you change the name of the field any unrecognized columns will not be imported by default. Kindly note that CSV Columns have a proper name and formatting as indicated in the Product CSV Import Schema.

    If your import is not working correctly, please check carefully your CSV follows the Import Schema and try to import products after switching to a default theme like Twenty Twenty-One or Storefront and disabling all plugins except WooCommerce.

    Hope this helps.

    Thread Starter simlock

    (@simlock)

    Ok thanks for your feedback.

    Let’s take as an example a CSV file where I have the fields :
    “Attribute 1 name”, “Attribute 1 value(s)”, “Attribute 2 name”, “Attribute 2 value(s)”

    Here are two cases that I tested :

    Case 1: I import my file as it is. Everything works. It recognizes well that there are two attributes to import.

    Case 2: In the CSV file, I change the name of the columns “Attribute X name” and “Attribute X value(s)” to a random name. WooCommerce does not recognize them anymore and sets them to “Do not import”.
    I force the “Map to field” to “Attribute Name” and “Attribute value(s)” and import.
    WooCommerce failed to import my attributes.

    As you said, WooCommerce uses a “Product CSV Import Schema” so in the end, I don’t understand why WooCommerce is trying to propose the intermediate step of “Map to field” when it will internally try to read the column names.

    Thanks again !

    Plugin Support Sol J. a11n

    (@solstudioim)

    Hi @simlock

    Thanks for sharing further context.

    Case 1: I import my file as it is. Everything works. It recognizes well that there are two attributes to import.

    Case 2: In the CSV file, I change the name of the columns “Attribute X name” and “Attribute X value(s)” to a random name. WooCommerce does not recognize them anymore and sets them to “Do not import”.
    I force the “Map to field” to “Attribute Name” and “Attribute value(s)” and import.
    WooCommerce failed to import my attributes.

    The Case 1 works since it’s following the default CSV Column Name.

    For Case 2, WooCommerce doesn’t recognize it as the column name isn’t the default formatting.

    I force the “Map to field” to “Attribute Name” and “Attribute value(s)” and import WooCommerce failed to import my attributes

    Basically, I’d suggest to follow the default formatting regarding the attribute column names.

    I am not sure why you’d change the attribute naming to something custom. As
    long as you can import attributes using Case 1.

    Otherwise, you might want to try Case 2 with all plugins disabled except WooCommerce, and switching the theme to Storefront temporarily, and see if the import works.

    The map field feature is to ensure that if there is some custom column header, we’ll be able to map those column header to corresponding correct field in WordPress.

    I hope that helps!

    If you have any other questions, do not hesitate to let us know!

    Thread Starter simlock

    (@simlock)

    I’m doing a Python script that’s inspired by the WooCommerce import tool and so I’m trying to figure out the point of this step.

    I’m not from the Web/Commerce world at all and so I’m trying to figure out how to adapt to a customer who comes in with their custom CSV file. I tend to believe that it could be
    possible that the column names are different from what WooCommerce expects and so how to adapt.
    I tought it was the purpose of the “Map to field” step

    Thank you for your answers !

    • This reply was modified 3 years, 6 months ago by simlock.

    Hey @simlock,

    I tend to believe that it could be
    possible that the column names are different from what WooCommerce expects and so how to adapt.
    I tought it was the purpose of the “Map to field” step

    That is correct that the field mapping process in the importer is there so that if a column name does not match the default CSV structure then users have the opportunity to tell WooCommerce which column it can find which data in.

    Our recommendation is always to follow the default CSV structure so that WooCommerce can automatch the CSV columns to the required product fields. However, in your case, if you are working with a CSV file that didn’t follow that structure, you would need to manually set the fields in the Map CSV fields to products section of the importer.

    I hope that helps!

    Kind regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘What is the use of “Map to field”’ is closed to new replies.