# Condition Visibility If there Is at least 1 Featured Product (Woocommerce)

**URL:** <https://forum.bricksbuilder.io/t/condition-visibility-if-there-is-at-least-1-featured-product-woocommerce/30017>\
**Category:** How To\
**Tags:** how-to\
**Created:** [February 6, 2025, 12:42pm UTC](https://forum.bricksbuilder.io/t/condition-visibility-if-there-is-at-least-1-featured-product-woocommerce/30017 "2025-02-06T12:42:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![simotamas7](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/simotamas7/32/22976_2.png) [@simotamas7](https://forum.bricksbuilder.io/u/simotamas7)\
**Post date:** [February 6, 2025, 12:42pm UTC](https://forum.bricksbuilder.io/t/condition-visibility-if-there-is-at-least-1-featured-product-woocommerce/30017/1 "2025-02-06T12:42:37Z")

</div>

Hey everyone!

I want to set a condition to a div to show or hide based on if at least one featured product is exist. Also want to the the same but for promotions.  
So the logic should be something like:

1. If at least 1 featured product exist = render the selected div.
2. If at least 1 product with promotion exist = render the selected div.

Is there anyone who had similar issue and managed to resolve it?

Appreciate any help!

---

<div class="post-metadata">

**Author:** ![frussane](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/frussane/32/24704_2.png) [@frussane](https://forum.bricksbuilder.io/u/frussane)\
**Post date:** [February 6, 2025, 12:50pm UTC](https://forum.bricksbuilder.io/t/condition-visibility-if-there-is-at-least-1-featured-product-woocommerce/30017/2 "2025-02-06T12:50:49Z")

</div>

Hi @simotamas7

If you’re using a Query Loop to display your products, you can use {query\_results\_count: **xxxxxx** } - **xxxxxx** being the ID for the Query Loop Element - as a Dynamic Tag to validate the number of results found:

![image](https://forum.bricksbuilder.io/uploads/default/original/3X/2/9/29b9d2498fbf147e0fc3159df01e97c915c9d505.png)

_Condition:_

![image](https://forum.bricksbuilder.io/uploads/default/original/3X/9/a/9a3e3feb75742efdcd0359636333d01bb40882da.png)

---

<div class="post-metadata">

**Author:** ![simotamas7](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/simotamas7/32/22976_2.png) [@simotamas7](https://forum.bricksbuilder.io/u/simotamas7)\
**Post date:** [February 6, 2025, 1:03pm UTC](https://forum.bricksbuilder.io/t/condition-visibility-if-there-is-at-least-1-featured-product-woocommerce/30017/3 "2025-02-06T13:03:56Z")

</div>

@frussane Thank you for the answer!

Sadly I’m using the products element provided by bricks.  
 ![products](https://forum.bricksbuilder.io/uploads/default/original/3X/e/8/e8ba1ec595b0c62d5488430d7705edae98bc5687.png)  
Any idea how can this be achieved with the products element?

If not I will probably make my own query as you mentioned.

---

<div class="post-metadata">

**Author:** ![frussane](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/frussane/32/24704_2.png) [@frussane](https://forum.bricksbuilder.io/u/frussane)\
**Post date:** [February 6, 2025, 1:21pm UTC](https://forum.bricksbuilder.io/t/condition-visibility-if-there-is-at-least-1-featured-product-woocommerce/30017/4 "2025-02-06T13:21:57Z")

</div>

I might be wrong, but AFAIK on that case you’ll probably have to get a PHP custom function to return true/false on those query results, in order to make it conditionally visible 🤔

Since the Query Loop provides an easy way to query both On Sale and Featured Products, I think you’d be better off this way!

Query Loop Woocomerce options when Products post type selected:

![image](https://forum.bricksbuilder.io/uploads/default/original/3X/c/6/c6151d5c936792697c33747531eb42ee046f99a0.png)

---

<div class="post-metadata">

**Author:** ![simotamas7](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/simotamas7/32/22976_2.png) [@simotamas7](https://forum.bricksbuilder.io/u/simotamas7)\
**Post date:** [February 6, 2025, 1:25pm UTC](https://forum.bricksbuilder.io/t/condition-visibility-if-there-is-at-least-1-featured-product-woocommerce/30017/5 "2025-02-06T13:25:35Z")

</div>

You are right, thank you so much for your help!
