Skip to main content
Contributor I
July 22, 2022
Solved

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

  • July 22, 2022
  • 6 replies
  • 902 views

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.
    Best answer by alex.hong

    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
    July 23, 2022

    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
    July 25, 2022

    Thank you, it works!

    Contributor I
    July 26, 2022

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

    alex.hong
    Klaviyo Alum
    July 26, 2022

    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
    September 25, 2023

    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
    September 26, 2023

    Hi there @rohan12334

     

    I answered your question in another thread you created below! 

     

    Thanks for sharing your question with us,

    -Taylor