Table of Contents
Document Status | PROPOSAL UNDER REVIEW |
---|---|
Document Owner(s) | |
Reviewers |
Context and epic
Epic: - TRX-1894Getting issue details... STATUS
Business problem to be solved
Currently, the new upsell modal is shown for all item types (Item, Combo, Picker, etc.)
Iberia aims to enhance the upsell rate and user experience by gaining more control over the new upsell modal trigger behavior. They plan to display the modal only for selected item types, such as Combo or Picker.
We'll also keep the same behavior for the first journey rule:
Show the modal only once per journey. For example:
The user adds a type Item to the cart -> The modal will not be shown
The user now adds a second item that is type Combo -> The modal will show
If the user decides to add another type Combo/Picker -> We'll not show the modal because the user already saw it on this first journey (in the same cart)
Proposal
File to be changed: src/state/order/index.js
Function that is responsible to trigger the logic today: openUpsellModal
The main logic
Adjust the openUpsellModal to handle a new path of logic
The idea is to keep the default behavior if the new logic is not enabled in Sanity: show the modal for any type of item
Create new functions to isolate the new logic (they can also be in a utils file, for example)
Function for the new variation logic (which will change the trigger behavior)
Functions to serve as utilities (for example, to know if the item is Combo/Picker)
Check the
newCartEntries
to be able to identify if the added item is a typePicker
orCombo
We can use Sanity to hold the logic that will change the upsell modal trigger behavior (more details at https://rbictg.atlassian.net/wiki/spaces/IBC/pages/4940922909/Analysis+-+Completa+tu+menu+using+new+Upsell+solution#Sanity-to-hold-the-new-trigger-behavior-configuration below)
The code below exemplify how things will be. Of course, this is just an example and will not represent the final solution.
Video explanation:
Upsell modal will only be shown for Pickers/Combos (if the new logic is enabled at Sanity)
When I’ve created a new journey, cleaning the cart and adding a Coca-Cola, the modal did not show as expected because Coca-Cola is a type
Item
Sanity to hold the new trigger behavior configuration
Add a new section in Feature Menu to configure the modal trigger behavior
For Whitelabel-App connection: We’ll need to at least develop a new hook to get the desired value configured in the new Sanity section. This hook will encapsulate the query and will be used inside
src/state/order/index.js
. The rest of the implementation will follow the same idea shown at https://rbictg.atlassian.net/wiki/spaces/IBC/pages/4940922909/Analysis+-+Completa+tu+menu+using+new+Upsell+solution#The-main-logic section.
This is a flexible solution. Can be extended or changed with a friendly user UI
Extra analysis details
The following details are not required to understand the proposed idea. I just took some notes for the future.
Add Comment