Solved

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

  • 22 July 2022
  • 6 replies
  • 517 views

Badge +1

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?

icon

Best answer by alex.hong 23 July 2022, 02:03

View original

6 replies

Userlevel 7
Badge +60

Hi there @rohan12334

 

I answered your question in another thread you created below! 

 

Thanks for sharing your question with us,

-Taylor 

Userlevel 1
Badge +3

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. 

Userlevel 7
Badge +58

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

Badge +1

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

Badge +1

Thank you, it works!

Userlevel 7
Badge +58

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

Reply