• I would like for the Parent product of a Grouped Product to be found in search results when searching for the Child product SKU. In our Grouped Products, the Child Products are hidden as we don’t want them found in search results – we only want to find the Parent.

    I can see how to achieve this for Variable Products by adding a function to index Variation SKUs. Is there a function I can implement that will do the same for Grouped products?

    Thank you

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)

    I’ve never heard of a Grouped Product. What does that mean in WordPress terms? Product variations are a separate post type with a post_parent value connecting them to the main product. How does the connection work with Grouped Products?

    If the connection is done using the post_parent and the only difference is the name of the post type, you can use the Variable Product method, just change the name of the post type in the code from product_variation to whatever is used for child products.

    Thread Starter markwrichards

    (@markwrichards)

    Sorry, I should have specified that we are using Woocommercwe which has Simple Products, Variable Products, Grouped Products and other product types. Grouped products have links to other products to form a parent product with child products. So in WordPress terms, the Parent Product is one post and each child product is its own post.

    This is different to a Variable product which has variations defined within the single product (post) and no additional products (posts).

    If my understanding is correct, the Variable Product Method which we have used successfully for our Variable Products is indexing within the Variations data of the same Product (post). Grouped Products would need to index based on their linked Products (posts). This would require different code and logic?

    Plugin Author Mikko Saari

    (@msaari)

    That’s what I’m trying to get to – how is the connection between the parent and the children implemented in grouped products? I think it’s likely it’s done the same way the variable products work, mostly because that’s the primary method of creating parent-child relationships with core WordPress. Thus the logic may well be the same. Based on a quick look at WooCommerce source code, it may also use custom fields.

    In any case, the basic principle is the same: you need a filter function on relevanssi_content_to_index that for each parent product fetches the child products and includes their SKUs to the parent product.

    I don’t know how grouped products work, so, unfortunately, I can’t provide that code for you, but I’m pretty sure you could give the variable product SKU function to any WooCommerce developer and tell them to replicate that for grouped products, and they should be able to do that. I can also help, if you can find me a good explanation on how grouped products work on technical level; I don’t have the time to go looking for one right now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Relevanssi Search Find Grouped Product Parent When Searching for SKU of Child’ is closed to new replies.