Versions Compared

Key

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

Table of Contents

...

Places where we have the Delivery fee information

PS: click on the images inside the table to open (I don’t want to flood the document). Besides that I forced the other fees and the discount value just to show how they will be on the screen… please, disregard the values.

...

The values come from the getOrder query (deliveryFee and deliveryFeeDiscount). In the frontend, this query will come from the usePriceOrder hook. More details here: /wiki/spaces/CPT/pages/3623190582

...

I found two feature flags used in delivery fee code (not directly related to what we have in the “Your Cart” section and with our proposals… just a mention):

...

  • The backend holds the logic of which value will be returned to the frontend part and we don’t know anything about that

  • The backend has a limitation with the fee delivery returning zero and no other info. With that, the frontend part can’t do anything about it

    • If the user enters the checkout page below the threshold backend will return the info for the delivery fee. We can save this value on the browser and use this latter, but

    • If the user enters the checkout page already above the threshold the backend will not return the values and the frontend only knows that the fee will be zero = free and can't save anything for future use

    • We can think of a solution using that but we need to have consistency on this UX/UI

  • If we need to go deep down on this backend part we don’t have a estimate for this because will be a discovery and as Maciej said any change should be done in a very careful way to not introduce regressions tests or bugs

Update - Calculation in FE logic

The calculation in FE is weird ( it subtracts not only discount, but also other fees from the main delivery fee ) and needs review:

2462725f-9bc3-45be-b469-da365e0f3622

...

image-20240208-221432.pngImage Added