Title: Problem with results
Last modified: August 31, 2016

---

# Problem with results

 *  Resolved [pspaulinha](https://wordpress.org/support/users/pspaulinha/)
 * (@pspaulinha)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/problem-with-results-1/)
 * In my example I check 2 items from my filter. “Corrida” and “Criança”. (sorry,
   my website is in Portuguese). But none of them have these “checks”, and appears
   5 options anyways.
 * Two have “Corrida” and three have “Criança”, but together anyone.
    My filter 
   work with “OR” or “AND” ?
 * [http://busqueseupersonal.com.br/wp-content/uploads/2016/05/personal.png](http://busqueseupersonal.com.br/wp-content/uploads/2016/05/personal.png)
 * [https://wordpress.org/plugins/woocommerce-products-filter/](https://wordpress.org/plugins/woocommerce-products-filter/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [RealMag777](https://wordpress.org/support/users/realmag777/)
 * (@realmag777)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427688)
 * Hello
 * The filter works with “OR”
 * Read next please:
    * [http://www.woocommerce-filter.com/hook/woof_products_query/](http://www.woocommerce-filter.com/hook/woof_products_query/)*
   [http://www.woocommerce-filter.com/filtering-by-product-attribute-doesn-work/](http://www.woocommerce-filter.com/filtering-by-product-attribute-doesn-work/)
 *  Thread Starter [pspaulinha](https://wordpress.org/support/users/pspaulinha/)
 * (@pspaulinha)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427710)
 * I don’t know if I understand
    Can I change to “AND”? Is possible? Can you help
   me?
 *  Thread Starter [pspaulinha](https://wordpress.org/support/users/pspaulinha/)
 * (@pspaulinha)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427712)
 * Sorry, I saw these text you sent me. I think I understood, thank you! 🙂
    I’ll
   try it.
 *  Plugin Author [RealMag777](https://wordpress.org/support/users/realmag777/)
 * (@realmag777)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427772)
 * Welcome 😉
 *  Thread Starter [pspaulinha](https://wordpress.org/support/users/pspaulinha/)
 * (@pspaulinha)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427813)
 * I tried to add this code in my theme functions.php, but it didn’t work 🙁
    (first
   link you sent me)
 * I would like my plugin work with “AND” for filter in “category” and “tag” too.
 * add_filter(‘woof_products_query’, ‘my_woof_products_query’);
 *  function my_woof_products_query($query)
    {
 *  $relations = array(
    ‘product_cat’ => ‘AND’ );
 *  if (!empty($query[‘tax_query’]))
    { foreach ($query[‘tax_query’] as $key => 
   $value) { if (in_array($value[‘taxonomy’], array_keys($relations))) { $query[‘
   tax_query’][$key][‘operator’] = $relations[$value[‘taxonomy’]]; } } }
 *  return $query;
    }
 *  Plugin Author [RealMag777](https://wordpress.org/support/users/realmag777/)
 * (@realmag777)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427821)
 * Hello
 * This works for shortcodes [woof_products] only and not with native (while) woo
   API. How did you made test? I mean drop me here shortcodes you tried …
 *  Thread Starter [pspaulinha](https://wordpress.org/support/users/pspaulinha/)
 * (@pspaulinha)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427856)
 * Sorry the delay, I have been tried something but I didn’t get sucess.
 * My test website is [http://busqueseupersonal.com.br/cadastro-provisorio/](http://busqueseupersonal.com.br/cadastro-provisorio/)
 * And in my widget, I tried to use in “Plugin | WooCommerce”, the sortcode [woof].
   And I used “WooCommerce Products Filter”, nothing =(
 *  Plugin Author [RealMag777](https://wordpress.org/support/users/realmag777/)
 * (@realmag777)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427858)
 * Hello
 * For this 2 weeks I did some code changes for native woocommerce request, so download
   index.php [http://www.woocommerce-filter.com/wp-content/uploads/2016/06/index-1.1.4.4.zip](http://www.woocommerce-filter.com/wp-content/uploads/2016/06/index-1.1.4.4.zip)
   of the plugin and replace it in the plugin folder by ftp, then in functions.php
   of your wp theme use next code:
 *     ```
       add_filter('woof_main_query_tax_relations', 'my_woof_main_query_tax_relations');
   
           function my_woof_main_query_tax_relations()
           {
       	return array(
       	    'product_cat' => 'AND'
       	);
           }
       ```
   
 *  Thread Starter [pspaulinha](https://wordpress.org/support/users/pspaulinha/)
 * (@pspaulinha)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427859)
 * Oh, I see!!
    Thank you for your attention, now it is working! 😀
 *  Plugin Author [RealMag777](https://wordpress.org/support/users/realmag777/)
 * (@realmag777)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427860)
 * Welcome 😉

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Problem with results’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-products-filter/assets/icon-256x256.png?rev=
   2844301)
 * [HUSKY - Products Filter Professional for WooCommerce](https://wordpress.org/plugins/woocommerce-products-filter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-products-filter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-products-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-products-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-products-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-products-filter/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [RealMag777](https://wordpress.org/support/users/realmag777/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/problem-with-results-1/#post-7427860)
 * Status: resolved