Hi,
I’m looking to set up an automated collection in my store, that will routinely update all of my sale items.
I know that I can do this using (‘compare at price’ ≠ 0) or (‘compare at price’ is not ‘empty’) - but I am wanting to go a step further.
I currently have my store with all ‘compare at price’ values filled all of the time - that way when I put something on sale (or take it off sale) I only have to update the base price and not both - which will obviously not work with the above functions.
I would like to be able to set an if function of sorts being:
IF (‘compare at price’ ≠ ‘base price’), include in collection, else ignore
But it’s been quite a number of years since I’ve done any formal type of coding and I have no idea how I would go about making this a CSS readable function for the collection.
Any help? I’m happy to do it the original way if it can’t be done - I’d just like to avoid that if I can…
Thank you!
1 Like
If you wanted to do it in the theme you could use liquid to compare the prices and control whether it shows or hides the item in the collection loop. As long as your CSS is set to to an automatic flex grid then it should show fine, though your collection numbers count per page may not be exact (maybe not an issue, because you could just lower the number of items in the collection retrieval to something like 20 per page, and pull in 50 items to account for filtering).
If you want to do with an app, Product Automator has a couple features that would work:
a) You could setup an automated product tag job that tags all products where price is not equal to compare price, then have a collection that looks for that tag.
b) You can create a custom collection: the app has functionality to create advanced collections.
Or, a manual way to do it if time is not an issue, you could use the method A I mentioned with the app, but just do it manually, when you are changing the prices.