Versions Compared

Key

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

Strikethrough

In price cart, we show the breakdown of fees below the subtotals.

...

Whenever the service Fee or the delivery Fee become zero, we need to strikethrough the original value, and show a label saying "Free”.

Use case : Non-zero delivery fee from Delivery Platform

  • If the delivery Fee - discount delivery Fee == 0

  • If the service Fee - discount Service Fee == 0

In principle, using the returned fee structure of the current tier is enough. Search in other tiers is not necessary.

It’s not necessary to strikethrough when the discount is partial.

Use case: Zero delivery fee from Delivery Platform

To solve this use-case, the app needs to retrieve the initial quotation (Lowest tier) to read the initial delivery fee and apply the strikethrough on the original value, IF the current delivery fee is zero because it was returned zero for the current tierWay-forward: Retrieve the initial quotation (Lowest tier) to read the initial delivery fee and apply the strikethrough on the original value, IF the current delivery fee is zero because it was returned zero for the current tier OR delivery fee minus discount results zero.

Note

DMP and Homeria are Delivery fee source of truth. Therefore, LD need to be in sync with them to avoid inconsistences of the information

Promotion

Use-case: Delivery fee or/and Service fee are FREE for all ranges due to a promotion.

In such case, the fee table modal needs one specific configuration to show the proper value in the strikethrough

{
"0":{
"app":{
"discount":400,
"serviceFeeDiscount":300,
"fee":400,
"serviceFee":300
} → fee (400) - discount (400) = 0, so I go to lowest tier and read how the fee was supposed to be (400)
},
"10":{
"app":{
"discount":300,
"serviceFeeDiscount":200,
"fee":300,
"serviceFee":200
} → fee (300) - discount (300) = 0, so I go to lowest tier and read how the fee was supposed to be (400)
},
"20":{
"app":{
"discount":200,
"serviceFeeDiscount":100,
"fee":200,
"serviceFee":100
}→ fee (200) - discount (200) = 0, so I go to lowest tier and read how the fee was supposed to be (400)
}
}

  • The logic of the strikethough is always based on the LOWEST tier as reference.

  • The same logic is used for serviceFee and serviceFeeDiscount

non-Promotion

Use-case: Delivery fee or/and Service fee are FREE in the middle/last ranges

{
"0":{
"app":{
"discount":0,
"serviceFeeDiscount":0,
"fee":400,
"serviceFee":300
} → fee (400) - discount (0) = 400, so I don’t show FREE and strikethrough
},
"10":{
"app":{
"discount":0,
"serviceFeeDiscount":0,
"fee":300,
"serviceFee":200
} → fee (300) - discount (0) = 300, so I don’t show FREE and strikethrough
},
"20":{
"app":{
"discount":200,
"serviceFeeDiscount":100,
"fee":200,
"serviceFee":100
}→ fee (200) - discount (200) = 0, so I go to lowest tier and read how the fee was supposed to be (400)
}
}

When it doesn’t have promotion (discount and serviceDiscount), we check if the fee for the cart current tier results in zero. If yes, it means that it’s FREE. So we show in the strikethrough the value of the fee from the LOWEST tier.


Solution

To achieve the goal, will be necessary calculate the value (fee - discountFee) to show the correct value (the old code make a calculus for the delivery fee, but no for the service fee).

The value will show always will be the highest value fee possible (even the lowest fee/high value already have a discount in modal).