Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #12664

    Hey i have a Relevanssi plugin filter in my function.php

    add_filter(‘relevanssi_hits_filter’, ‘separate_result_types’);

    function separate_result_types($hits) {

    $types = array();

    $no_of_products=3 ;

    $no_in_array=0 ;



    $compare_array = array();

    // Split the post types in array $types

    if (!empty($hits)) {

    foreach ($hits[0] as $hit) {

    if (!is_array($types[$hit->post_type])) $types[$hit->post_type] = array();





    array_push($types[$hit->post_type], $hit);






    else if ($hit->post_type==’post’ && $no_of_blog_in_array<3)


    array_push($types[$hit->post_type], $hit);



    // array_push($types[$hit->post_type], $hit);



    This works great on search page , but my product search now always shows me NO match found . But when i remove the filter it can find the product , is there someway possible that i can just add the filter to the search form on header and not on product widget .

    do they use different templates or anything ??



    Did you try to contact the plugin author: ? To be honest I’m not familiar with the Relevanssi API/hooks/filters.

    Best regards,


Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Relvenassi Plugin and woocommerce product search widget not working’ is closed to new replies.