Table of Contents


Problem to be solved

When we bring the loyalty offer promo code flow to the checkout page we forgot to think in the offer replace scenario. In the legacy /offers page when the user tried to apply an offer when already have some offer applied will have this:

image-20240304-190145.png

Current problem at checkout page solution demonstration:

Offer replaced without warning.mp4

Discovery and solution proposal

Discovery

I discover that the CBA/legacy checkout offers code already has a modal to show when replacing an offer:

Offer CBA MODAL.pngimage-20240304-202032.png

Considerations

Proposal

With this discover in mind:

From the design perspective we only need to decide who this modal will be:


Acceptance criteria


Tech refinement breakdown

Task 1: adjust cart-promo-codes.view.tsx to accept modal values through params

File to be changed: frontend/src/pages/cart/cart-promo-codes/cart-promo-codes.view.tsx

image-20240304-193421.png

We need to adjust in a way that we can receive the following through params:

Tip: I can se two options here:

DOD-LIKE

Task 2: use-redeem-promo-code-checkout.ts hook to return necessary information for the extended modal

Files to be changed:

Proposed changes:

DOD-LIKE