Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CostSummary): define applied discount based on cost field #2698

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const getTotal = (shopSession: ShopSession) => {
}

export const getCrossOut = (shopSession: ShopSession) => {
const hasDiscount = shopSession.cart.redeemedCampaigns.length !== 0
const hasDiscount = shopSession.cart.cost.discount.amount > 0

if (!hasDiscount) return undefined
return shopSession.cart.cost.gross
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const getCartTotal = (cart: CartFragmentFragment) => {
}

const getCartCrossOut = (cart: CartFragmentFragment) => {
const hasDiscount = cart.redeemedCampaigns.length !== 0
const hasDiscount = cart.cost.discount.amount > 0

if (!hasDiscount) return undefined
switch (cart.redeemedCampaigns[0].discount.type) {
Expand Down