• Resolved masini2002

    (@masini2002)


    Hi!

    I have selected that the search engine (Lite) searched in product SKUs.

    But when I search for the SKU of a variable product (with different variations, each with its own SKU), it does not find the product.

    Is it possible to search by SKU in variable products?

    • This topic was modified 4 years, 8 months ago by masini2002.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    The variation SKUs as far as I know are stored in the same exact custom field as the normal product SKUs.

    Make sure that the product variation post type is selected, as well as the _sku custom field. Keep in mind, that this may only work for the live search feature – the WooCommerce results page in most cases filters out the variations from the results.

    Best,
    Ernest M.

    Thread Starter masini2002

    (@masini2002)

    The product is variable. And their variations have different SKUs. But they are not found in the live search.

    In the Seach lite options if I search for custom fields I get “_sku”. I have added “_sku” and “variation_description”.

    But I’m not getting search results if I search for a SKU number.

    I have Woocomerce configured as normal and the variations are the native Woocomerce variations.

    In other search plugins I have found that there are problems searching for variations sku. For example SearchWP needs to include a PHP function:

    WooCommerce stores Product Variations as separate posts, so the first step will be to tell SearchWP to store some custom metadata for the parent product

    https://searchwp.com/v3/docs/kb/woocommerce-product-variation-skus/

    Plugin Author wpdreams

    (@wpdreams)

    Thank you, I know that.

    If you select the product_variation custom post type for search, the plugin will return those as well, and link to the original product.
    For example I made a variable product, and made variation #1 SKU: ABCD1234
    When I search for 1234, I am getting that variation as the result: https://i.imgur.com/Hlhe3Hq.png
    To make sure that is the correct result, on the advanced title and content fields I added the {_sku} field: https://i.imgur.com/nasJDLh.png

    Best,
    Ernest M.

    Thread Starter masini2002

    (@masini2002)

    It works perfectly. Thanks for the support!

    Plugin Author wpdreams

    (@wpdreams)

    You are welcome 🙂

    I will mark this as resolved then.

    Feel free to reate the plugin if you like it, it is greatly appreciated 🙂

    Best,
    Ernest M.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘SKU variations’ is closed to new replies.