Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Table of Contents

...

  • Offer Discount: This is the only offer that we are supporting on the checkout page today

  • Combo and Picker: Not supported today

    • Current limitation: we need to bring the necessary logic for the other types of Config Offer to the checkout page when applying a promo code through our new feature/field

    • We are analyzing this subject on a PoC:

      Jira Legacy
      serverSystem JIRA
      serverId255417eb-03fa-3e2f-a6ba-05d325fec50d
      keyIBFEC-1505

      • The PoC will be useful to prove if we'll be able to bring the necessary logic and detect if this can cause any problems to the checkout page or the offers page legacy logic

...

PoC results and proposal of solution

Work in progress

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:

...

  • Get the promotional Combo/Picker from the incentives array (configured on the Config Offer document) by adjusting the graphql query to get the whole item

  • Transform the item and add it to the cart:

    • Use the transformMenuObjectToCartItemto convert the item configured on In-App Benefits

      • This method will be responsible for getting the price, modifiers, etc

      • This method needs to be properly filled out to get the correct data

      • Use getSelectionsFromMenuData to get the correct modifiers for the item

      • Use transformUserSelectionsComboToComboSlotSelections together with ProductWizardUtils.SetDefaultSelectionsto get the default values for a Combo item. As we are adding the offer Combo directly through the cart, we need to “select” the defaults for the user. This is important because we need the information in Recent Orders, etc.

    • Use the upsertCart from useOrderContext to add the promotional item to the cart

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.

...

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

Known problems/Problems to be solved

  • Legacy bug: if the user presses F5 at the checkout page, the offer Combo/Picker will be removed from the Your Cart section. This is not related to our implementation or the PoC results.

  • To be solved: I was able to add the Picker without problem but the price sometimes is wrong. This needs to be fixed (blue star). More details on the Tech refinement doc above.

Assumptions and business rules

...

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?

...

A: We should keep the default behavior if possible:

  • Add the item as an offer item

  • Keep the default options selected for the user

  • Show the “edit” button on the cart offer item (to be validated/aligned. PoC ongoing)

Business rules / Acceptance criteria

...

  • The user should not be redirected to the menu page when applying a promotional code directly through the checkout page (for Offer Combo/Picker)

  • Add the offer item with the defaults selections for the Combo/Picker

  • Show the “edit” button on the cart offer item. The edit button should send the user to the menu page for the edited item (to be validated/aligned on PoC. In progress (blue star)

    Jira Legacy
    serverSystem JIRA
    serverId255417eb-03fa-3e2f-a6ba-05d325fec50d
    keyIBFEC-1536
    )

  • The behavior must be closely to the legacy flow /offer page:

    • The item added to the cart should be exactly as we are adding it through the legacy flow (sub-items, price, etc)

    • The item should be correct at Recent Orders or email (like the legacy flow)

    • The offer item should not be available to add again to a new order after being used (blocked by the application by default).