• Resolved James

    (@jmdesignsolutions)


    Hi,

    I have a website that is using Relevanssi and working well but for one small problem.

    My site uses Woocommerce and I have several products with variations however when I search only the parent product appears. Is there anyway to get all the variations to show up as well? I notice there’s a searching/indexing option for a “product_variation” post type which is excluded from the search, should this be enabled?

    Any help/advice would be greatly appreciated!

    Thanks,

    James

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

    (@msaari)

    Yes, it starts by making Relevanssi index the “product_variation” post type. However, there’s usually a bit more to this, as since you noticed, it’s excluded from the search.

    Then on the Searching tab of Relevanssi settings, you need to uncheck “Respect exclude_from_search for custom post types”.

    The final hurdle is that most WooCommerce themes restrict the search results to the post type “product” and won’t allow other post types in the results. You can circumvent that, but the look of the search results template may be bound to the “product” post type, and it may break down when you include other post types.

    Thread Starter James

    (@jmdesignsolutions)

    Hi Mikko,

    Thanks for the prompt reply and for the clarification on things.

    I’ve just tweaked the settings as per your suggestions and it works perfectly now.

    Many thanks,

    James

    Thread Starter James

    (@jmdesignsolutions)

    Hi Mikko,

    Just following this up as I’ve spotted something, only the parent product has a description and price in the search results not any of the variations. Do you know if it’s possible to do this via your plugin or is this something that needs adding via the theme template coding?

    Thanks,

    James

    Plugin Author Mikko Saari

    (@msaari)

    What shows up in the search results page is 100% your theme. Relevanssi just gives a list of posts, and how they are displayed is your the responsibility of your theme.

    Thread Starter James

    (@jmdesignsolutions)

    Hi Mikko,

    Okay thanks, it’s just a little strange why the short description and price shows up for the main parent product but not the variations (the code is very simple).

    Thanks again,

    James

    Hi,

    I have the same problem, but even if i uncheck “Respect exclude_from_search for custom post types” the search doesn’t return result for “product_variation” (but for normal product it’s work)

    Do you have any idea what i can try ? (i have also talk to my editor template about this problem)

    Best regards, Florian

    • This reply was modified 6 years, 1 month ago by neutragelsav.
    Plugin Author Mikko Saari

    (@msaari)

    Please post to a new thread, because once a thread falls of the first page, I generally don’t see it anymore.

    Most likely your theme is restricting the search results to just the product post type. Allowing product_variation will likely break things, as most WooCommerce themes are designed to only show products in search results.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Indexing Product Variables Post Type’ is closed to new replies.