Creating discounted collections based on product expiry date
You can turn the products with Freshly discounts into a sale collection on your store. Freshly adds your discount tags to a product while one of its batches is discounted and removes them when the discount ends. A smart collection based on that tag stays up to date automatically.
Before you start, turn on batch discounts and add at least one tag. See Using automatic discounting for batches expiring soon. Batch discounts are available on paid Freshly plans.
Step 1: Add a discount tag in Freshly
- In Freshly, go to Preferences > Batch discounts.
- In Tags, enter the tag to use for your collection (for example,
clearance). Separate multiple tags with commas. - Click Save.
Use a tag that's reserved for this feature. When a product's discount ends, Freshly removes these tags from the product, even if someone added the same tag by hand.
Step 2: Create a collection in Shopify
- From your Shopify admin, go to Products > Collections.
- Click Add collection.
- Enter a title (for example, "Weekly specials") and an optional description.
- Add this condition: Tag includes
clearance(use the tag you set in Freshly). - Click Save. Products that currently have the tag appear in the Products section.
- Under Sales channels, choose where the collection should be available.
Optional: only show products with a compare-at price
If every discounted product has only one variant, you can add a second condition, Compare at price is set, and set products to match all conditions. Don't use this for products with multiple variants. Shopify only matches when every variant has a compare-at price, and Freshly only sets a compare-at price on the variant it discounts.
Step 3: Show the collection to customers
Add the collection to your store's navigation, or feature it on your home page with a collection section in the theme editor (names vary by theme).
How the collection updates
- When a batch enters the discount window, Freshly discounts the variant and adds the tag to its product, and the product joins the collection.
- When no batches of that product are discounted anymore, Freshly removes the tag, and the product leaves the collection.
- If you turn off batch discounts, Freshly removes the tags from all products and the collection empties.
The tag is on the product, so the whole product appears in the collection even if only one of its variants is discounted.
Please reach out to our team at hello@freshly.io if you have any questions.