Conditional rendering of a section in a template

Conditional rendering of a section in a template

m4tyash
Visitor
1 0 0

Hi, I have a product that has a metafield called "Child category". The problem I am facing right now is, that I need to dynamically hide the "Featured Collection" section based on if the value of "Child category" is filled or no.

m4tyash_0-1719337208140.png

 

Eventually, I would like to have an else statement. So in pseudocode it would look something like this:

if product.childCategory has value:

Show Featured Collection

Hide Related Products

else

Hide Featured Collection

Show Related Products

 

How can I achieve this? I am using a custom template based on Dawn 13.0.

 

Thanks

Replies 0 (0)