Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
The goal is to have a page that dynamically displays active coupon codes to avoid updating the page manually.
I had thought creating a boolean metafield would do the trick paired with some liquid on the page. However I don't see an option to create a discount metafield. I also learned that liquid templating doesn't natively support querying or displaying active discount codes directly since Shopify doesn't expose discount objects to the storefront or Liquid templates. We wouldn't want to display ALL active coupon codes anyways, only certain ones.
Any ideas?
I'm not sure if it's possible now that the Discount object has been deprecated. You can access codes currently applied to a cart, maybe there's a way to create a hidden cart somewhere which has the necessary products included, but that could get convoluted.
Codes do have a unique URL which always starts with myshopify.com/discount/ so perhaps there is a way to access them that way?