Announcement

Collapse
No announcement yet.

Dynamic coupon codes?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Dynamic coupon codes?

    We want to create a page to list various limited coupons. Limited in usage and with fairly short expiration dates.
    Would there be a way to hide or gray-out coupons (codes) that have expired or have reached their usage limit?
    Has anyone done anything like this?
    pat
    http://lockitt.com

    #2
    You should probably use the Claude or Codex Page Builder skills to build something that gets you 99% of the way there. The only thing I don't think it would be able to do is keep count of usages, but sometimes it surprises me.

    Have you played with that at all?

    You can download the skills from here: https://docs.miva.com/developer/addi...rces/mivalabs/

    Then just prompt what you want and it will build it. I find that you prompt, it builds, you test, it's close, you do another round until you get what you want.
    Thanks,

    Rick Wilson
    CEO
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      I haven't run this through the paces yet, but it just built this for me.

      Notes from Claude (USE AT YOUR OWN RISK, TEST IT FIRST):

      cx-coupon-list is packaged and ready to upload via User Interface → Flex Components.

      To your core question: yes, and it's better than a manual toggle. Admins enter only the coupon codes; instance.mvt resolves each one server-side with Coupon_Load_Code() and mirrors the exact validity rules Runtime_Coupon_Load_Code applies at checkout — active, dt_start/dt_end, and use_count vs max_use. Expired and fully-claimed detection is authoritative, not admin-maintained, and a Page Builder setting chooses gray out with a status badge ("Expired" / "Fully Claimed") or hide completely.

      Everything you selected is in: live countdowns that flip a card to expired in-browser the second it lapses (server-relative offsets, so browser clock skew can't lie), click-to-copy code pills, "Only 8 left!" scarcity counters from live remaining uses, and unavailable-sorts-last. Plus a few things the use case implied: "Coming Soon" state for future-dated coupons that auto-activates when the start time passes, an optional age-out ("remove expired after N days"), and a configurable empty-state message.

      One scoping note: max_per and customer-scope restrictions are passed through but not evaluated — a public listing page can't know who's shopping, so per-customer limits belong in the fine-print field. Worth a human review pass before it goes on a production store, per policy.
      Also remove the .zip from the Flex Component so the file ends in .tar.bz2 which is what Miva expects, I had to alter it to post on the forums.

      Create a page with your header and footer, then use PageBuilder to add this Component to test it. Once you have it working the way you want voila.
      Attached Files
      Thanks,

      Rick Wilson
      CEO
      Miva, Inc.
      [email protected]
      https://www.miva.com

      Comment

      Working...
      X