This topic has 10 replies, 2 voices, and was last updated 2 years, 10 months ago ago by Olga Barlow
Is there any way to setup searching by product tags with the live search?
I DO see that searching for product tags has been added and completed within the Taskboard here: https://www.screencast.com/t/lTvofWT7o5sP
But I do not see an option for this anywhere within the theme customization tools. Please advise.
Hi Olga,
I do see that option. However, the live search does not show results for product tags. For example, my product has a tag named “t-shirt” and I have that tag listed in the tags section within the live search, but when I click on the tag “t-shirt” no products are found. Is there any known way to add product tag searching to your live search bar?
Thank you
Hello,
Nope, we don’t have such an option for the search input, unfortunately. It requires additional customization or use a third-party plugin to implement such search.
Regards
Hi Olga,
Is there anyway that you can help me implement the Relevanssi search plugin into the theme’s live search plugin so that users can search product tags. I have added the Relevanssi search plugin and setup the queries and it appears that the plugin is working for the search, but not the live search. I did a search on the comments section and it looks like someone else was able to get it setup here: https://www.screencast.com/t/7IZ7k2YPsU but I cannot seem to get it working. This is the plugins knowledge base https://www.relevanssi.com/category/knowledge-base/ Do you have any knowledge of how to get this functioning with your theme? Thank you for your time.
Hello,
Does that plugin have the search widget or search form shortcode with the live search? In this case, you’ll be able to replace our search element with the plugin shortcode using the HTML block element.
Regards
Hi Olga,
Actually, Relevanssi creates a custom search index and replaces the internal WordPress search. So what I am trying to do is turn off the XStore search queries/index within your live search and allow Relevanssi to provide the search queries with its index instead. I hope this makes sense.
So I reached out to the Relevanssi plugin developer and he has strived to make his plugin compatible with all of the big themes, and he is interested in making compatible with your theme as well.
The plugin developer provide this code for me to enter into functions.php and it allowed me to add WooCommers Product and Product Taxonomies (i.e. Product Tags, Variations, etc.) to your themes Live Search:
add_filter( ‘etheme_ajax_search_products_query’, function( $args ) {
$args[‘relevanssi’] = true;
return $args;
} );
He said that in order to make all other Post Types and Taxonomies to be compatable with your theme is for you to simply add a filter hook to the post search, it’d be one line of code, and then it would be easy to make that search use Relevanssi indexing queries.
The plugin developer provided this: “Could you please add a filter for the get_posts() arguments in
get_posts_results() in class-ajax-search.php, matching the etheme_ajax_search_products_query filter in get_products_results()?”
This would allow the users of your theme to use Relevanssi for searching Product Tags and any other Post Type and custom Taxonomy as they see fit, and the plugin is free to do all of this. They have a premium version, but this is not necessary for the Post Types I have mentioned.
Please let me know if this can be accommodated? Thank you for your time.
Hello,
I passed your request to our developers. They will add etheme_ajax_search_posts_query filter in the next theme update.
Regards
Tagged: how to, json, live search, product tags, search tips, woocommerce, wordpress
You must be logged in to reply to this topic.Log in/Sign up