Table of Contents


To have more context: Tech discovery - Discount codes at checkout

Default/legacy behavior to apply different Config Offer types through offers page

Today the promotion code only supports Config Offer type Combo, Picker and Offer Discount.

image-20240125-202227.png

Offer Combo/Picker

The behavior will be the same: when adding to the cart the user will be redirect to the menu item to configure the item and then apply to the cart:

Offer picker.mp4

Offer Discount

Different from Offer Picker or Offer Combo, the Offer Discount is added directly to the cart when applied. The user don't need to be redirected to the menu page.

Discount Offer demonstration.mp4

Config Offer type that we support today at checkout page

image-20240125-205309.png

How we can add support do Combo/Picker (PoC results and proposal of solution)

The main idea is to have the “same behavior” that we have on the /offers screen when dealing with a Combo/Picker offer. The main challenges that I faced here were:

Results validated on the PoC

Option 1 - Transform and apply “In-App Benefits” Combo/Picker item directly (desired)

From what I understood, we can’t directly use menu items from Sanity, meaning that we need to always convert the item using the utilities and methods from the Wizard architecture. With this in mind:

Problem with this solution: the Combo/Picker that comes from the Config Offer document will not have the vendorConfigs for the children items (sub-items) and without this information, when we add the item to the cart, we'll have only the main item, without the sub-items/modifiers. From what I understood, if an item doesn’t have the vendorConfig information, it will be considered invalid.

Option 2 - Query and validate the promotional item and then transform/apply

This solution is similar to Option 1 but here I solved the problem mentioned above:

Tech refinement doc here with more details: Tech refinement - Add offer Combo/Picker to the cart

Known problems/Problems to be solved

Adds the ability to edit the Combo/Picker item

The main idea is to show the edit button for a Combo/Picker offer item, like the following example:

image-20240208-210405.png

This work and proposals are described here: Tech Refinement - Edit Button

Assumptions and business rules

Questions and assumptions

Q: Today, when we redeem a promo code offer that has the type Combo/Picker on the offers page and the user clicks to add the offer to the cart, the application will redirect the user to the menu item (combo/picker) for the selected offer. On the menu page, the user can customize the Combo/Picker if allowed. If the user adds a Config Offer that has this type (Combo/Picker) through the checkout page, he'll not be able to customize the item. What will we do here? Can we consider the default options for the Combo/Picker?

Offer customization.mp4image-20240126-142329.png

A: We should keep the default behavior if possible:

Business rules / Acceptance criteria


FAQ

Golden rule: 90% of the behaviors will be equal to what we have on the /offers page. If we don’t know if something is a bug or not, we need to first check the behavior of the offer if we add it through the /offers page.

For Combo/Picker what's the difference from what we have on the /offers page?

A: All the behavior regarding price, item information, etc. will be the same. The only difference is the following:

Can we replace an offer at the checkout page?

A: Yes, the behavior will be the same that we have in the /offers page

Can we edit the Combo/Picker in the cart preview?

A: Yes. In some cases, after editing the item, the user will not be redirected to the checkout page again, but this is an expected behavior regarding how the cart preview works. Always compare the editing function using other items to be sure if there is a bug or not

After adding the offer to the cart, the price is wrong, or I'm receiving an error saying that the offer is not available at the selected restaurant or that the product added is invalid

A: 90% of the time, we'll have a problem with configurations:

In this task, I provided a tutorial on how we can discover if the PLU is configured or if it is available at the restaurant. Open the card to see more details