Skip to content

Commit

Permalink
Checkout: Always display non-zero discount in checkout footer (#96315)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbrillig authored Nov 12, 2024
1 parent 2baebaa commit dac90ba
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default function BeforeSubmitCheckoutHeader() {
const subTotalLineItemWithoutCoupon: LineItemType = {
id: 'subtotal-without-coupon',
type: 'subtotal',
label: totalDiscount > 0 ? translate( 'Subtotal before discounts' ) : translate( 'Subtotal' ),
label: totalDiscount !== 0 ? translate( 'Subtotal before discounts' ) : translate( 'Subtotal' ),
formattedAmount: formatCurrency( subtotalBeforeDiscounts, responseCart.currency, {
isSmallestUnit: true,
stripZeros: true,
Expand All @@ -126,7 +126,7 @@ export default function BeforeSubmitCheckoutHeader() {
<WPOrderReviewSection>
<NonTotalPrices>
<NonProductLineItem subtotal lineItem={ subTotalLineItemWithoutCoupon } />
{ totalDiscount > 0 && <NonProductLineItem subtotal lineItem={ discountLineItem } /> }
{ totalDiscount !== 0 && <NonProductLineItem subtotal lineItem={ discountLineItem } /> }
{ taxLineItems.map( ( taxLineItem ) => (
<NonProductLineItem key={ taxLineItem.id } tax lineItem={ taxLineItem } />
) ) }
Expand Down

0 comments on commit dac90ba

Please sign in to comment.