• Resolved joyryde

    (@joyryde)


    We have a unique situation and can’t find any prior answers to this that are useful.

    We have a product that is for vehicle tires. Vehicle tires come in 1,000 different sizes, but the product SKU that we sell only has about 0 sizes because they fit multiple tire sizes.

    When we set the variable product to have a tire size selection dropdown on the product, and then correlate each tire size to the SKU that applies to it, it won’t work because it says there are duplicate SKU’s.

    How should we be doing this?

    Here’s the manufacturers website with the sized/SKU’s:

    https://shopautosock.mcgeecompany.com/

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Abiola Ogodo

    (@oaoyadeyi)

    @joyryde

    Kindly try the suggestion provided here.

    I hope this helps! Let me know if you have further questions or if you need further assistance.

    Thread Starter joyryde

    (@joyryde)

    Hi, that won’t work. SKU’s are mandatory with Google Shopping and you can’t just make up fake SKU’s. The SKU is a part number created by the manufacturer and is necessary when sent to Google Shopping in the data feed, so the SKU must be only as specified by the manufacturer.

    Hey @joyryde,

    Have you tried using this filter to allow duplicate SKUs?

    
    add_filter( 'wc_product_has_unique_sku', '__return_false' );
    

    You can add it to the site using the Code Snippets plugin or by adding it to the theme’s functions.php file. When I use that on my site, it’ll allow multiple products to share an SKU.

    I hope that helps out.

    Thread Starter joyryde

    (@joyryde)

    PERFECT, I will try this! Thanks!

    Hi @joyryde

    You’re welcome. I’m marking this thread as resolved now. If you have any further questions, feel free to start a new topic!

    Thread Starter joyryde

    (@joyryde)

    I think this snippet is causing a ton of PHP errors on the site, as we are seeing these in our logs:

    [07-Dec-2021 23:15:46 UTC] PHP Notice: id was called <strong>incorrectly</strong>. Product properties should not be accessed directly. Backtrace: require_once('wp-admin/admin.php'), do_action('admin_action_duplicate_product'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Admin_Duplicate_Product->duplicate_product_action, WC_Admin_Duplicate_Product->product_duplicate, WC_Product->save, WC_Data_Store->create, WC_Product_Data_Store_CPT->create, WC_Product_Data_Store_CPT->handle_updated_props, do_action('woocommerce_product_set_stock'), WP_Hook->do_action, WP_Hook->apply_filters, WPO_Cache_Rules->purge_product_page, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong

    Mirko P.

    (@rainfallnixfig)

    Hi @joyryde,

    These are not errors but notices/warnings of duplicate products because you allowed duplicate SKUs. Most of the time these notices can be simply ignored and should not cause any issues on your site.

    Thread Starter joyryde

    (@joyryde)

    Aah, ok, thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Same SKU for Numerous Variations’ is closed to new replies.