NO BUG: Condition on whole DIV (Empty field)

Browser: Chrome 110
OS: macOS
URL: Darilni komplet- Welcome Baby – Little Art Queendom
BRICKS Version: 1.11.1.1

In the store on each product I have some fields such as SKU code, category, and tag. I can’t figure out why I can’t hide the entire DIV with conditionals I have the structure

  • DIV (first) and inside:
    – Icon
    – Text

The conditionals work but only work on --text (it hides this element, but not the icons and the div)

Here is result if SKU field is empty:

Div + icon are still there.

Hello @dsteam,

The {woo_product_sku} will return <span> element, that just happens that it’s without text content, if there is no SKU.
That means, that when you check if {woo_product_sku} is empty on a element that does not have SKU defined, you basically check id <span class="sku"></span> is empty. Which is not, so the condition will show it.

If you use {woo_product_sku:value} though, it should work, as it will not return the <span> wrapper, so checking if it’s empty should work.

Please try and let me know if it solves it for you :slight_smile:

Thanks,
Matej

Dear Matej,

Thank you for all the explanations.

I am attaching a image for someone else.
SCR-20241210-iukr

You don’t need this for categories and tags and it works without it.

SCR-20241210-iygp

1 Like

Perfect, I’m happy that it works :slight_smile:

I’m marking this topic as no bug now.

Matej