mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🩹 Hide gateway on PayNow page when ineligible
This commit is contained in:
parent
354a9ff175
commit
a4d3af848c
2 changed files with 6 additions and 7 deletions
|
@ -275,7 +275,7 @@ class ApplePayButton {
|
|||
}
|
||||
|
||||
// Classic Checkout: Apple Pay gateway.
|
||||
if ( CONTEXT.Checkout === this.context ) {
|
||||
if ( CONTEXT.Gateways.includes( this.context ) ) {
|
||||
selectors.push( '.wc_payment_method.payment_method_ppcp-applepay' );
|
||||
}
|
||||
|
||||
|
@ -364,12 +364,10 @@ class ApplePayButton {
|
|||
return;
|
||||
}
|
||||
|
||||
// Classic Checkout: Make the Apple Pay gateway visible after page load.
|
||||
if ( CONTEXT.Checkout === this.context ) {
|
||||
document
|
||||
.querySelectorAll( 'style#ppcp-hide-apple-pay' )
|
||||
.forEach( ( el ) => el.remove() );
|
||||
}
|
||||
// Classic Checkout/PayNow: Make the Apple Pay gateway visible after page load.
|
||||
document
|
||||
.querySelectorAll( 'style#ppcp-hide-apple-pay' )
|
||||
.forEach( ( el ) => el.remove() );
|
||||
|
||||
this.allElements.forEach( ( element ) => {
|
||||
element.style.display = '';
|
||||
|
|
|
@ -966,6 +966,7 @@ class ApplePayButton implements ButtonInterface {
|
|||
$render_placeholder,
|
||||
function () {
|
||||
$this->applepay_button();
|
||||
$this->hide_gateway_until_eligible();
|
||||
},
|
||||
21
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue