Skip to content

Commit

Permalink
fix(CostSummary): define applied discount based on cost field
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermespopolin committed Jul 6, 2023
1 parent be5fa01 commit e9d3e27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion apps/store/src/components/CartInventory/CartInventory.tsx
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

0 comments on commit e9d3e27

Please sign in to comment.