Skip to content

Commit

Permalink
Always show Express payment buttons for Pay for Order page (#7535)
Browse files Browse the repository at this point in the history
elazzabi authored Nov 2, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 5265b45 commit 45b8d13
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-express-pay-pay-for-order-page
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Show Google Pay/Apple Pay buttons in the Pay for Order page
7 changes: 5 additions & 2 deletions includes/class-wc-payments-payment-request-button-handler.php
Original file line number Diff line number Diff line change
@@ -381,8 +381,6 @@ public function display_pay_for_order_page_html( $order ) {
];

wp_localize_script( 'WCPAY_PAYMENT_REQUEST', 'wcpayPaymentRequestPayForOrderParams', $data );

$this->display_payment_request_button_html();
}

/**
@@ -531,6 +529,11 @@ public function should_show_payment_request_button() {
return false;
}

// Order total doesn't matter for Pay for Order page. Thus, this page should always display payment buttons.
if ( $this->is_pay_for_order_page() ) {
return true;
}

// Cart total is 0 or is on product page and product price is 0.
// Exclude pay-for-order pages from this check.
if (

0 comments on commit 45b8d13

Please sign in to comment.