How to display exact WooCommerce product with Query Builder?

Many users would want to filter and showcase WooCommerce Products on their website. The Woo – Products widget provides an inbuilt Query Builder that allows you to either display All Products or filter them by applying Custom Query or even select each product Manually.

Below are the options available for product selection-

Basic Options
Choose the product Source from the following options-

1. All Products (?)
Choosing this option will display all published products.
Many times, you would want to display all the products. But, at the same time, you might want to exclude some particular products.
Use following options to exclude certain products-

  • Exclude Product
    • Start typing the product name and select it manually to exclude from all product list.
    • For Example- If available products are X, Y, and Z. Selecting All Products option will display X, Y, Z products. But if you wish to exclude Y product then type Y in the text box. It will exclude the Y product from the list and will display only X and Z.
  • Exclude Current Product
    • If you wish to exclude currently displaying product from all product list to avoid a duplicate appearance, use this option. Set the toggle to exclude current product.
    • For Example-  If available products are X, Y, Z and they come under same category A. If products from category A set to display on all single product page. Then while viewing X product, all products including X will be displayed at the bottom of the page.  To avoid the duplicate appearance of X select to  Exclude Current Product. So that only Y and Z will be displayed on X product page. Similarly, Y will be excluded from its single product page and X, Z will display.

2. Custom Query (?)
This option allows filtering products depending on the Category and Tag assigned. Choose Category and/or Tag to display or exclude.

  • Category Filter Rule
    • Decide whether you want the selected category to be displayed (Match Categories) or excluded (Exclude Categories) from the list.
    • If you choose Match Categories then only products from selected categories will be displayed.
    • If you choose Exclude Categories then the products from the selected categories will be excluded and all the products of the remaining categories will be displayed.
    • After selecting the Category Filter Rule start typing the name of the category that needs to be selected for the above action.
  • Tag Filter Rule
    • Choose if the selected tag should be displayed (Match Tags) or should be excluded (Exclude Tags) from the list.
    • If you choose Match Tags then only products from selected tag will be displayed.
    • If you choose to Exclude Tags then products from selected tag will be excluded and products from all remaining tags will be displayed.
    • After selecting the Tag Filter Rule start typing the name of the tag that needs to be selected for above action.
  • Offset
    • It is a number of products that should be excluded from the above category OR tag list.
    • For example- If a particular category has 10 products assigned and if the offset is set to 2 then first 2 products will be excluded from the list and only 8 products will be displayed.

Many times, you would want to display all products from particular category or tag. But, at the same time, you might want to exclude some particular products.
Use the following options to exclude the products-

  • Exclude Product
    • Start typing the product name manually to exclude from category/tag product list.
    • For Example- X, Y, Z products belong to category A. If category A is set to display then all products i.e. X, Y, Z will be displayed. But if you wish to exclude Y product then type Y in the text box. It will exclude the Y product from the list and will display only X and Z.
  • Exclude Current Product
    • If you wish to exclude currently displaying product from category/tag product list to avoid a duplicate appearance, use this option. Set the toggle to exclude current product.
    • For Example-  X, Y, Z products are assigned to category A. If products from category A set to display on all single product page. Then while viewing X product, all products including X will be displayed at the bottom of the page.  To avoid the duplicate appearance of X select to Exclude Current Product. So that only Y and Z will be displayed on X product page. Similarly, Y will be excluded from its single product page and X, Z will display.

3. Manual Selection (?)
This option provides full flexibility to choose particular products. Start typing the name of the product that needs to be displayed and select it when it appears. You can select a number of products this way.
For Example- Available products are U, V, W, X, Y, Z. If you wish to display only V, X, Z then just type V then X and then Z in the text box provided.

Advanced Options
These options allow refining the above-filtered list.

  1. Filter By
    • Featured– Choosing this option will display WooCommerece Products from the above list that are set as featured. (?)
    • Sale– Choosing this option will display WooCommerece Products from above list that are set for sale. (?)
  2. Order by (?)
    Choose an option from the drop-down menu to arrange products and the order you wish to display them in.
Not the solution you are looking for? Check other articles, or open a support ticket.