Conditional Product Info in Product Grid (Dawn Theme)

Conditional Product Info in Product Grid (Dawn Theme)

deannedawe
Visitor
1 0 0

I've been successful adding custom product metafields to my product grid for the products on my store, but I just realized that these metafields will appear for ALL products and I only need them to apply to my House Plans. I also have a collection called "Detached Garage Plans" and the info about Beds/Baths/Heated Sq Ft isn't applicable to those items. 

Any idea how I can have different metafields appear in the product grid based on the collection? I'm Xnapper-2025-05-21-14.38.55.jpg

Reply 1 (1)

Guleria
Shopify Partner
4193 812 1168

Hello @deannedawe ,

 

If you are using metafields with dynamic source then it's not possible.

But if you are using the metafields direct in code part then you can make it conditional like this:

{% if collection.handle == 'house-plans' %}
  <!-- Your logic here for House Plans collection --> 
  Your metafield code here
{% endif %}

 

In this way it displays content for specific collections.

 

Regards
Guleria

- Custom themes, UI/UX design, ongoing maintenance & support.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder