PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Redefine text search SQL request - Limit to one category

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi.

I have been trying to limit the search by text field for a specific product category and not for all products, but without success.

I am trying to use the woof_text_search_query filter, but even using specific Posts IDs, the search form still filters all products:

add_filter('woof_text_search_query', function($where, $woof_text) {
global $wpdb;
$where .="AND $wpdb->posts.ID IN(217453,217454,217455)";
return $where;
}, 99, 2);

Please see: https://tinyurl.com/ygmthbnm

Can you please help? How can I use the hook to search only in one specific product category?

Thanks.

 

Hello

what plugin version number are you using?

Hi.

I am using v.2.2.5.3

Please  drop  me  exact  link  to the issue and  better  wp-admin  access - https://c2n.me/43SC6rb.png ->https://c2n.me/42BAoj4.png

Hello.

I sent to you access to staging site and credentials to see it.

If it will not be enough then I will create an user account for you - wp-admin

Hi.

Did you had the time to look at this issue?

Thanks

Hello

I  did  a  test  - https://c2n.me/4c01wNO.png  - Id of this  product - 217453

Everything seems to be working correctly.

Hello.

Thank you for your reply.

Maybe I was not very clear. The problem is that I need to limit the search just for one category and not for all shop products.

As you can see here: https://tinyurl.com/ygmthbnm, when you search for number"1" in text field for example, it filters products from all shop.

How can I limit search / filter just for one specific category?

Can you help please?

Thanks

Hello

I understood you!

add IDs of products that belong to the category - https://c2n.me/4c0EWC7.png

And it works - https://c2n.me/4c0EYVR.png