Skip to content

Commit

Permalink
Display express payment buttons on checkout blocks pay-for-order page (
Browse files Browse the repository at this point in the history
  • Loading branch information
hsingyuc authored Oct 30, 2023
1 parent cc3e504 commit 691e342
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Display express payment buttons on checkout blocks pay-for-order page
5 changes: 4 additions & 1 deletion client/payment-request/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ import { getPaymentRequest, displayLoginConfirmation } from './utils';

jQuery( ( $ ) => {
// Don't load if blocks checkout is being loaded.
if ( wcpayPaymentRequestParams.has_block ) {
if (
wcpayPaymentRequestParams.has_block &&
! wcpayPaymentRequestParams.is_pay_for_order
) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,9 @@ public function should_show_payment_request_button() {
}

// Cart total is 0 or is on product page and product price is 0.
// Exclude pay-for-order pages from this check.
if (
( ! $this->is_product() && 0.0 === (float) WC()->cart->get_total( 'edit' ) ) ||
( ! $this->is_product() && ! $this->is_pay_for_order_page() && 0.0 === (float) WC()->cart->get_total( 'edit' ) ) ||
( $this->is_product() && 0.0 === (float) $this->get_product()->get_price() )

) {
Expand Down

0 comments on commit 691e342

Please sign in to comment.