• Resolved mravat

    (@rosso711)


    Hi,

    I am trying to bulk import some products along with their attributes.

    The file i am using is an .xlsx one. I am very clear with all fields except the ones of attributes.

    I have a lot of attribute columns starting from column C which is the “Product Brand’ till the very end of the file.

    How do i import those ? I managed to do it by manually writing the Attribute’s name in the Name field and dragging the attributes value from the node on the right side (in the WooCommerce Add-on -> Attributes section).

    And when i run the procedure, all was imported perfectly. But this is not quite efficient when there are many attributes like in my case. I have to manually create all attributes. And what about future updates? How will that work?

    Looking forward to to your reply.

    Thank you in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @rosso711

    I managed to do it by manually writing the Attribute’s name in the Name field and dragging the attributes value from the node on the right side (in the WooCommerce Add-on -> Attributes section).

    This is the correct way to add attributes in the import template. There’s no other way to do it.

    And what about future updates? How will that work?

    You only have to map the attributes once and they’ll be saved in the import template. The only reason you’d have to map new attributes would be if new ones were added to your import file.

    Hey @wpallimport
    The attributes in my XML feed are structured like this:
    <name>Color</name>
    <value>Green</value>
    <name>Size</name>
    <value>Medium</value>
    and so on and so fourth. Additionally, the name-value-pairs are not always in the same order (sometimes Size would come before Color) and there are different ones for different kinds of products.

    How can I import this?
    The only way I see it could work is if I add like 10 attributes (more than the amount on the product that has the most) and drag in the Name and Value ones in the respective field. That would create new attributes for each product feed though and I’d like to be able to merge the attributes by mapping them against my own ones…

    What would you suggest I do?

    Hello @luck3rm
    did you find the solution to your problem ? I’m in the same situation.
    Thanks.

    Hello @davidserrano72
    I received a snippet of code from WP All Import support that solved the problem.

    “Yes, it looks like you can use a custom PHP function for this: https://www.wpallimport.com/documentation/developers/execute-php/. The idea would be to pass the name of the attribute you want along with all of the names/values, then loop through them to find the value. Here’s how you’d call the function:

    [my_get_attribute_value(“SIZE”,array({Extras/Name}),array({Extras/Value}))]

    And the code would be:

    function my_get_attribute_value( $attr, $name, $value ) {
    if ( empty( $name ) || empty( $value ) ) return;

    $names = explode( “, “, $name[0] );
    $values = explode( “, “, $value[0] );

    foreach ( $names as $key => $v ) {
    if ( $v == $attr && array_key_exists( $key, $values ) ) {
    return $values[ $key ];
    }
    }
    }”

    thanks… checking

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Importing products attributes’ is closed to new replies.