Support » Plugin: Import Products from any XML or CSV to WooCommerce » Set variants to the “ANY” attribute instead of Value

  • Resolved technicalx

    (@technicalx)


    Hi,

    How would I import my variants without creating a variant for every combination?

    I have one line for each with possible values, but I just want one parent product and one child variant with each option set as “ANY X”, “ANY Y”, etc.

    My CSV is like this
    product name,attribute1,value1a|value1b

    By default the import will create two variants for the above, but I just want one with the Variant values set to the empty “ANY” option since they all have the same price and no stock management in my case.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter technicalx

    (@technicalx)

    a bit more specifically, there is this function but it only affects more than 1 variant value rather than 1 or more.

    // set them all to the ANY option instead of unique combinations for everything.
    function wpai_wp_all_import_variation_any_attribute( $variation_any_attribute, $import_id ) {
        return TRUE;
    }
    add_filter( 'wp_all_import_variation_any_attribute', 'wpai_wp_all_import_variation_any_attribute', 10, 2 );
    Plugin Contributor WP All Import

    (@wpallimport)

    Hi @technicalx,

    I have one line for each with possible values, but I just want one parent product and one child variant with each option set as “ANY X”, “ANY Y”, etc.

    That may require custom code, but I’d need to see your CSV data to properly advise. To avoid making that data public, please contact us about this issue at http://www.wpallimport.com/support/. Include a copy of your file and a brief description of the issue (and/or a link to this thread).

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.