How to let woof work with custom search query
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 pleaseIf 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.
Quote from Orlin on October 29, 2019, 13:58Hello,
I have prepared the following:
$args_product = array('post_type' => 'product','post__in' => $post_ids,'posts_per_page' => 24,'paged' => $paged,'orderby' => 'post__in');$product_query = new wp_query( $args_product );from here onward, I may iterate thru the result. So far, so good but I also want to active the available filters like that:echo do_shortcode( '[woof]' );I'd like to have woof working with that new $product_query. How to achieve that?
Hello,
I have prepared the following:
Quote from Pablo Borysenco on October 30, 2019, 12:56Hello
Read this please - https://products-filter.com/hook/woof_get_tax_query/ AND https://products-filter.com/hook/woof_get_meta_query/
Hello
Read this please - https://products-filter.com/hook/woof_get_tax_query/ AND https://products-filter.com/hook/woof_get_meta_query/
Quote from Orlin on October 30, 2019, 17:53Hello,
It doesn't answer my question!!!
$product_query = new wp_query( $args_product );
That's completely new, custom, out of any wordpress flow. That's the Wordpress object which I'm asking how to pass over to woof for applying the filters, already defined in the admin interface.
Hello,
It doesn't answer my question!!!
$product_query = new wp_query( $args_product );
That's completely new, custom, out of any wordpress flow. That's the Wordpress object which I'm asking how to pass over to woof for applying the filters, already defined in the admin interface.
Quote from Orlin on October 31, 2019, 07:30One more thing: I tried that one
add_filter('woof_get_tax_query', 'my_woof_get_tax_query');function my_woof_get_tax_query($tax_args){echo $tax_args.'TEST';return $tax_args;}echo do_shortcode( '[woof]' );It does't print the args with TEST at the end. Actually - because of my custom query, the filters applied that way are on ALL of the products in the shop.I'm looking for something like that:add_filter('woof_query', 'my_woof_query');function my_woof_query($args){$args->set('post__in' , $my_custom_id_array);$args->set('orderby' , 'post__in');return $tax_args;}echo do_shortcode( '[woof]' );
One more thing: I tried that one
Quote from Orlin on October 31, 2019, 12:05Or something like:
global $WOOF;
$WOOF->setQuery($my_custom_products_query);
echo do_shortcode('[woof]');
Or something like:
global $WOOF;
$WOOF->setQuery($my_custom_products_query);
echo do_shortcode('[woof]');
Quote from Pablo Borysenco on October 31, 2019, 14:14Hello
To get license key - https://c2n.me/44mFaPK.png
These hooks are only for taxonomies and meta data.
To add another arguments - please use standard hooks for WP_Query - pre_get_posts
Do you want it use this only for filter?
Hello
To get license key - https://c2n.me/44mFaPK.png
These hooks are only for taxonomies and meta data.
To add another arguments - please use standard hooks for WP_Query - pre_get_posts
Do you want it use this only for filter?
Quote from Orlin on October 31, 2019, 14:21I put the license.
pre_get_posts is called too early. Here I'm talking for completely custom WP_Query object which I'd like to have woof working with somehow.Tried to set$GLOBALS['wp_query'] = $my_product_query;But seems like woof doesn't consider it. The best would be to have something like
$WOOF->setQuery($my_custom_products_query_object);and afterwards the execution of the shortcode.If not available - what is the price to have it working that way and how much time?
I put the license.
But seems like woof doesn't consider it. The best would be to have something like
Quote from Pablo Borysenco on November 1, 2019, 13:01Hello
pre_get_posts is called too early. - ???
If not available - what is the price to have it working that way and how much time? - https://pluginus.net/contact-us/
Hello
pre_get_posts is called too early. - ???
If not available - what is the price to have it working that way and how much time? - https://pluginus.net/contact-us/