Liquid, JavaScript, themes, sales channels
Hey there,
I am using debut theme and want to lower the opacity for out of stock items, but only when they are from a certain product type.
I found this:
.grid-view-item--sold-out .product-card__image-with-placeholder-wrapper{
opacity: 0.1 !important;
}
to be pasted on the bottom of theme.css. Which works, but I only want it to happen when the products have the product type 'Uitverkocht'.
I think the solution should be simple, but my understanding of liquid is not enough yet to make this happen haha.
I have tried some '{% if sold_out and product.type != "Uitverkocht" %}' '{% endif %}' things, but can't get it to work.
Thank you in advance!
'{% if sold_out and product.type != "Uitverkocht" %}' '{% endif %}'
It is correct way but little bit changes in condition to do and also it's matter where you put this condition.
For my perspective, add condintion inside product loop and give one class called 'uitverkocht_soldout'.
Then add below css
.grid-view-item--sold-out.uitverkocht_soldout .product-card__image-with-placeholder-wrapper{
opacity: 0.1 !important;
}
Hi @24by7themes thank you for your reply.
Could you tell me how and where I do this: 'Add condition inside product loop and give one class called 'uitverkocht_soldout'.? Sorry, my knowledge of Liquid is very basic.
My webshop is www.bickerykerst.nl and the product type I created is 'Uitverkocht' with a capital U.
Maybe anyone else that can help me? I haven't fixed this yet.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024