Woocommerce – Search by tags - by vasikgreif

This topic has 5 replies, 3 voices, and was last updated 9 years, 11 months ago ago by Olga Barlow

  • Avatar: vasikgreif
    vasikgreif
    Participant
    November 14, 2014 at 20:36

    Hi, I need to have the autocomplete include tags. I installed this plugin – https://wordpress.org/plugins/search-by-product-tags-for-woocommerce/ – which takes care of adjusting the default search to include product tags, but id doesn’t work with the autocomplete. I fount the function et_get_search_result(), but frankly have no idea how to change it to include the tags. Can you help me on this one? (looks like a great addon to the core btw.)

    4 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    November 15, 2014 at 11:08

    Hello,

    Sorry, but we don’t provide guarantee of full compatibility of 3rd-party plugins with our theme as we don’t test all plugins.
    Please take our apologies for inconveniences.

    Regards,
    Eva Kemp.

    Avatar: vasikgreif
    vasikgreif
    Participant
    November 15, 2014 at 11:37

    Hi. I didn’t mean I need to make it work with this plugin. What I really need is to be able to search by tags, and I hoped the code in the plugin might help with that…

    Avatar: vasikgreif
    vasikgreif
    Participant
    November 16, 2014 at 22:45

    OK, I managed to build this functionality myself… I had to edit theme-functions.php, to be able to filter the WP_Query() object.

    Can you please confirm that you include this change in the next theme update? It doesn’t break anything, just adds a possibility to change the posts returned…

    function et_search_get_result($args) {
    		extract($args);
    		$query = apply_filters('et_search_get_result',new WP_Query( $args ));
    	
    .......
    

    The full code to achieve searching products by tags in your ajax search is here (supposed there’s the filter available):

    http://pastebin.com/HNF452hb

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    November 20, 2014 at 16:20

    Hello,

    Ok, we’ll include this code in our next update. Thank you for cooperation, we appreciate it!

    Regards,
    Olga Barlow

  • Viewing 5 results - 1 through 5 (of 5 total)

The issue related to '‘Woocommerce – Search by tags’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.