VNEXT-83184: Redesign checkout coupon UI - #1439
abansal2-godaddy wants to merge 12 commits into
Conversation
Implement combined coupon input states (default, filled, success, error) in DiscountStandalone, add DiscountAppliedBar, and extend enUs discounts strings for GOLF to translate into other locales. Co-authored-by: Cursor <cursoragent@cursor.com>
Versioning can be handled in the release workflow; the coupon redesign does not need a local changeset. Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: 8475b7a The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Bump @godaddy/react and @godaddy/localizations so the Version Packages workflow can publish after merge. Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify in DiscountStandalone and DiscountAppliedBar that the redesign cannot reuse the old input/button/chip composition, so those imports were dropped from this path. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the explanation in the PR description and review comments instead. Co-authored-by: Cursor <cursoragent@cursor.com>
abansal2-godaddy
left a comment
There was a problem hiding this comment.
Reviewer notes (also in the PR description): why the layout changed, and why the old discount imports were dropped from — without leaving that rationale in the source files.
| import { eventIds } from '@/tracking/events'; | ||
| import { TrackingEventType, track } from '@/tracking/track'; | ||
| import { Discounts } from './discounts'; | ||
| import type { DiscountFormProps } from './types'; |
There was a problem hiding this comment.
Why these imports changed / why the old ones are gone from this file
Previously this file composed:
DiscountInputDiscountApplyButtonDiscountErrorListDiscounts/DiscountTag
Those matched the old UX (separate input + button, large alert errors, chip tags with code only).
VNEXT-83184 needs a different UX, so those imports were removed from this path:
- Input + Apply (or clear) must live in one bordered row → not standalone
DiscountInput/DiscountApplyButton - Errors are a short helper under the field → not
DiscountErrorList - Success needs code + formatted amount + remove in a full-width bar → not chip
DiscountTags
The old modules are still in the package/exported for now; they just are not used by DiscountStandalone anymore. Cleanup can be a follow-up.
| inputInMinorUnits = true, | ||
| onRemove, | ||
| isRemoving, | ||
| }: DiscountAppliedBarProps) { |
There was a problem hiding this comment.
Why a new DiscountAppliedBar instead of tweaking DiscountTag
DiscountTag is a small chip (tag icon + code + X) and has no amount. The success state in the design is a full-width green bar: check + code + – $amount + remove.
That is a different component shape, so we added this bar for DiscountStandalone rather than overloading the chip. DiscountTag / Discounts remain in the package unused by this path until a cleanup PR.
Reviewer note: layout vs old importsDetails are on the Files changed tab (inline comments) and in the updated PR description. Short version
|
…c intact. Preserve the original code collection and handlers; limit the change to the new coupon UI, amount lookup for the success bar, and error helper copy. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@abansal2-godaddy - is the main goal here to show each coupon codes value instead of a single discount total? I'd prefer not to make huge design changes if possible. We currently follow a similar pattern to other checkouts so I don't think it would be confusing users thinking it's mandatory. |
No @pbennett1-godaddy ,It's more of a UI and experience change only with proper error states and intent when a C1 applies a coupon. |
you can use the nextjs sample app in this repo to test against a dev/test env store. Can you look into what discount GPAs actually return on failure? I don't think we should have a default of "Coupon isn't valid" cause I think there is basically only a single error of "coupon code failed to apply" from the BE. Invalid would lead customers to believe the coupon they tried to use even if there was an error was an invalid code. |
Yes you are right, I'll check what we get as response under various cases from BE and have the error state render the intended failure |
…s copy. Keeps one-coupon UX aligned with design and avoids calling codes "invalid" when checkout-api only returns DISCOUNT_APPLICATION_FAILED. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Match h-12 checkout fields, drop package-owned coupon heading keys, and expose checkout.summary.discount before/after slots for hosts. Co-authored-by: Cursor <cursoragent@cursor.com>

Summary
Implements VNEXT-83184: redesign the checkout coupon / promotion code UI (default → filled → success → error).
Where this lives:
@godaddy/reactDiscountStandalone(used by Bruce whenenablePromotionCodesis on).Design
h-12, theme tokens) — input + Apply (or clear on error)accentsurface,foregroundtext)checkout.summary.discount.before/.after(not shipped in the package)Error copy
Maps GraphQL codes via
apiErrors, falls back tofailedToApply(does not claim every failure is an “invalid” code).What changed
discount-standalone.tsx/discount-applied-bar.tsxcheckout.summary.discount.before|afterplaceholder,enterCode,apply, …) — no new en-US-only stringsTest plan
checkout.summary.discount.beforeif desired