Skip to main content
Contributor I
Jul 22, 2022 2:03 PM UTC
Solved

Hide/show logic to exclude products from order overview not working?

HI! I am trying to exclude a specific product from a repeated content block (the administration fees)). I am using event data for the logic. I have entered the following logic:

event.ProductnamenList.title != 'Administratiekosten (eenmalig)'

 

The event is called ‘ProductnamenList’
The product variable is called ‘title’
The specific product is ‘Administratiekosten (eenmalig)’

 

However, the product ‘Administratiekosten (eenmalig)’ is still showing up in the order overview. What am I doing wrong?

    This topic has been closed for replies.
    alex.hong
    alex.hongAnswer
    Klaviyo Alum
    Jul 23, 2022 12:03 AM UTC

    Hi @PennyTinyLibrary,

    Welcome to the Community.

    You can hide items from the Dynamic Table Block using conditional statements in each column.

    You can base this on product titles, SKUs, prices, etc. An example would be:
    {% if item.product.title != "Exact Product Title" %} Display this content. {% endif %}
    If you are unsure about using conditionals, I would recommend chatting with a developer to help you build those statements!

     

    Hope this helped,

    Alex

    6 replies

    alex.hong
    alex.hongAnswer
    Klaviyo Alum
    Jul 23, 2022 12:03 AM UTC

    Hi @PennyTinyLibrary,

    Welcome to the Community.

    You can hide items from the Dynamic Table Block using conditional statements in each column.

    You can base this on product titles, SKUs, prices, etc. An example would be:
    {% if item.product.title != "Exact Product Title" %} Display this content. {% endif %}
    If you are unsure about using conditionals, I would recommend chatting with a developer to help you build those statements!

     

    Hope this helped,

    Alex

    Contributor I
    Jul 25, 2022 8:23 AM UTC

    Thank you, it works!

    Contributor I
    Jul 26, 2022 7:44 AM UTC

    Is this also possible for dynamic images in Dynamic Table Blocks?

    alex.hong
    Klaviyo Alum
    Jul 26, 2022 7:58 PM UTC

    Hi @PennyTinyLibrary,

    For your images or dynamic tables, I would take a look at this article and use the show/hide feature to display specific blocks only. 

     

    Thanks!

    Alex

    Active Contributor I
    Sep 25, 2023 6:47 PM UTC

    Hi @PennyTinyLibrary,

    Welcome to the Community.

    You can hide items from the Dynamic Table Block using conditional statements in each column.

    You can base this on product titles, SKUs, prices, etc. An example would be:
    {% if item.product.title != "Exact Product Title" %} Display this content. {% endif %}
    If you are unsure about using conditionals, I would recommend chatting with a developer to help you build those statements!

     

    Hope this helped,

    Alex

    Hi @alex.hong I used this solution to tackle a similar problem and it kinda worked too. 

    But now, as you can see in the image above, I am getting all of this white space from the content that is hidden. So is there no way to remove this?

    {% if event.line_price != 0 %} {{ event.name|default:'' }} {% endif %}

    This is the code that I am using. 

    Taylor Tarpley
    Community Manager
    Community Manager
    Sep 26, 2023 8:28 PM UTC

    Hi there @rohan12334, 

     

    I answered your question in another thread you created below! 

     

    Thanks for sharing your question with us,

    -Taylor