Tags active products with 'on-sale' when any variant has a compare-at price above its current price, and removes the tag when nothing is discounted.
async def run(ctx): for product in await ctx.shopify.query(ACTIVE_PRODUCTS): on_sale = any( v.compare_at_price and v.compare_at_price > v.price for v in product.variants
If you run a sharper version of this template, or something it inspired, send it in. We review every application and publish the good ones, credited to you or your agency.
Describe the job, watch the AI build it, rehearse it, deploy it.
Free plan · no card · 🇪🇺 EU data residency