Skip to content

Wire up coupon Apply button in mobile checkout #17

@mighty840

Description

@mighty840

Description

The mobile checkout screen has a coupon code input and an "Apply" button, but the button has no onPress handler. The coupon code is collected but never validated or applied against the API.

The storefront web version correctly calls the coupon validation API — the mobile version is missing the equivalent handler.

Files to Change

  • packages/mobile/app/checkout.tsx — lines 224–227

Steps

  1. Add an onPress handler to the Apply Pressable component
  2. Call the coupon validation API endpoint (see storefront checkout for reference)
  3. On success, apply the discount to the order total
  4. On failure, show an error message to the user
  5. Handle loading state while validating

Reference

  • Storefront coupon implementation: packages/storefront/src/pages/Checkout.tsx
  • API endpoint: POST /api/coupons/validate

Effort

S — well-defined feature with a clear reference implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions