Custom Collection Automation

Topic summary

Goal: Automatically surface all sale items when “compare at price” is always populated, by including products where compare_at_price ≠ price, without manually managing two prices.

Theme-based option (Liquid): Use Liquid in the collection loop to compare price vs. compare_at_price and conditionally render items. This hides non-sale items on the front end; layout should work with a flexible CSS grid, but pagination/counts may be off, so consider fetching more items per page to compensate.

App-based options: Product Automator can (a) auto-tag products when price ≠ compare_at_price, letting a collection include that tag, or (b) create advanced/custom collections that meet this condition.

Manual fallback: Apply the tag yourself when changing prices if automation isn’t needed.

Notes: The implementation is in Liquid (theme templating), not CSS. No code snippets were provided. Outcome: Viable approaches identified; no single chosen solution yet, discussion remains open.

Summarized with AI on December 13. AI used: gpt-5.

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.