I'm new to Shopify and I'd like to know how to loop and filter through all the products in my collection object to remove the sale price for sold out items.
Is this possible using Liquid? I know the basics after taking a crash course on YouTube but I don't know in which file I would apply this logic. The whole Shopify landscape is still a bit foreign to me.
The liquid is an open-source template language created by Shopify and written in Ruby. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. Liquid has been in production use at Shopify since 2006 and is now used by many other hosted web applications.
The filter() method is a pure function and does not change the original array instead it will return a new array that satisfies the requirement of the provided function in the argument.
Using filter(), you can filter out unnecessary data.
I hope this helps.