Shopify themes, liquid, logos, and UX
Hey
I added a collapsible row to add a size chart
But I noticed now all of my products have a collapsible row (only the ones I populated with metafield page have content in them, the rest are empty)
I want to have the collapsible row only for those 6 products I need it for, and have the collapsible row disappear from the other products.
How can I do that?
Thank you 🙂
Hi @Oneg
To fix this you can add a common tag on those 6 products and put the metafield code in the condition like below.
<!-- Extra info for custom tags -->
{% for tag in product.tags %}
{% if tag contains 'myTag' %}
//Your metafield code here
{% endif %}
{% endfor %}
This code will prevent the metafield code to populate on all the products and will appear only on the products that have your added tag on 6 products.
Thanks
Sheesh B
Hi @Oneg ,
As collapsable rows are part of "main-product.liquid", you will have to update this file to achieve it. If you are using dawn theme, you can add bellow codes on the file.
On line number 193 add
{% unless block.settings.content == "" and block.settings.page == "" %}
On line number 211 add
{% endunless %}
The updated code should look like this [Text marked in red are code that i have added]
If you require further help to add the code to your store, please don't hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
Mangit
For quick response - Message Me
Increase Xmas sales with BOGO+ Easy Free Gift Upsell. Get 30% OFF for 3 months with code "BFWIZZ30".
hey thank you for the reply, it didn't work for me, placed the codes exactly like your picture showed inside main-product.liquid.
To be clear, I want the whole drop down list in the picture to disappear. For this product in the picture, I didn't put a size chart, it's irrelevant. But I do want this size chart drop down to exist in other products where it's relevant.
Hi @Oneg
Did you added the tag to product where it's relevant?
In my code I'm using 'myTag', you can specify your tag and change that tag in the code as well where it says myTag.
<!-- Extra info for custom tags --> {% for tag in product.tags %} {% if tag contains 'myTag' %} //Your metafield code here {% endif %} {% endfor %}
I hope this explains.
Thanks
Sheesh B
hey, where do i paste this code?
User | RANK |
---|---|
203 | |
171 | |
77 | |
56 | |
51 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023