Skip to content

Commit

Permalink
Resolve issues after the merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dmvrtx committed Nov 14, 2024
1 parent 5df0203 commit 1fcd893
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions client/express-checkout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,11 @@ jQuery( ( $ ) => {
order,
} = wcpayECEPayForOrderParams;

if ( total === 0 ) {
wcpayECE.hide();
return;
}

wcpayECE.startExpressCheckoutElement( {
mode: 'payment',
total,
Expand Down Expand Up @@ -618,7 +623,7 @@ jQuery( ( $ ) => {
} else {
// If this is the cart or checkout page, we need to request the
// cart details.
api.expressCheckoutECEGetCartDetails().then( ( cart ) => {
api.expressCheckoutECEGetCartDetails().then( ( cart ) => {
if ( cart.total.amount === 0 ) {
wcpayECE.hide();
} else {
Expand All @@ -633,7 +638,8 @@ jQuery( ( $ ) => {
?.needs_payer_phone ?? false,
displayItems: cart.displayItems,
} );
}
}
} );
}

// After initializing a new express checkout button, we need to reset the paymentAborted flag.
Expand Down

0 comments on commit 1fcd893

Please sign in to comment.