Woocommerce SKU Results
-
Hi,
We have a Woocommerce site which has both simple and variable products. We need customers to be able to find products by SKU.I’m using the below snippet so that the parent product is shown when a variation SKU search result is found:
https://www.relevanssi.com/knowledge-base/indexing-product-variation-skus-main-product/I’m also using the first snippet on this page so that only exact SKU matches are shown:
https://www.relevanssi.com/knowledge-base/return-only-exact-matches-for-sku-searches/However, because I’m using the relevanssi_content_to_index filter the relevanssi_hits_filter only works for simple products.
So I tried the 2nd snippet on this page: https://www.relevanssi.com/knowledge-base/return-only-exact-matches-for-sku-searches/
Now with that in place it shows the parent product when searching for a variable product SKU successfully.
However, when searching for an SKU for a simple product, no results are shown.
I need the exact SKU matching to work for both simple and variable products.
Can you advise if this is possible and how to achieve it?Thanks.
- The topic ‘Woocommerce SKU Results’ is closed to new replies.