mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Do not hide button on change payment page
This commit is contained in:
parent
4fe5a63f42
commit
f0ff7de9fa
3 changed files with 11 additions and 3 deletions
|
@ -15,6 +15,7 @@ import {
|
|||
PaymentMethods
|
||||
} from "./modules/Helper/CheckoutMethodState";
|
||||
import {hide, setVisible} from "./modules/Helper/Hiding";
|
||||
import {isChangePaymentPage} from "./modules/Helper/Subscriptions";
|
||||
|
||||
const buttonsSpinner = new Spinner('.ppc-button-wrapper');
|
||||
|
||||
|
@ -108,7 +109,10 @@ document.addEventListener(
|
|||
const hideOrderButtonIfPpcpGateway = () => {
|
||||
// only in checkout and pay now page, otherwise it may break things (e.g. payment via product page),
|
||||
// and also the loading spinner may look weird on other pages
|
||||
if (!['checkout', 'pay-now'].includes(PayPalCommerceGateway.context)) {
|
||||
if (
|
||||
!['checkout', 'pay-now'].includes(PayPalCommerceGateway.context)
|
||||
|| isChangePaymentPage()
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import CheckoutBootstap from './CheckoutBootstap'
|
||||
import {isChangePaymentPage} from "../Helper/Subscriptions";
|
||||
|
||||
class PayNowBootstrap extends CheckoutBootstap {
|
||||
constructor(gateway, renderer, messages, spinner) {
|
||||
|
@ -6,8 +7,7 @@ class PayNowBootstrap extends CheckoutBootstap {
|
|||
}
|
||||
|
||||
updateUi() {
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
if (urlParams.has('change_payment_method')) {
|
||||
if (isChangePaymentPage()) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
export const isChangePaymentPage = () => {
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
return urlParams.has('change_payment_method');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue