mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Display payment gateways also when the are set to display:none with css and the stylesheet is removed from DOM
This commit is contained in:
parent
bbd25f89e8
commit
a453e4e881
5 changed files with 28 additions and 0 deletions
|
@ -38,6 +38,12 @@ class CardFieldsFreeTrialRenderer {
|
|||
if ( hideDccGateway ) {
|
||||
hideDccGateway.parentNode.removeChild( hideDccGateway );
|
||||
}
|
||||
const dccGatewayLi = document.querySelector(
|
||||
'.wc_payment_method.payment_method_ppcp-credit-card-gateway'
|
||||
);
|
||||
if (dccGatewayLi.style.display === 'none' || dccGatewayLi.style.display === '') {
|
||||
dccGatewayLi.style.display = 'block';
|
||||
}
|
||||
|
||||
this.errorHandler.clear();
|
||||
|
||||
|
|
|
@ -44,6 +44,12 @@ class CardFieldsRenderer {
|
|||
if ( hideDccGateway ) {
|
||||
hideDccGateway.parentNode.removeChild( hideDccGateway );
|
||||
}
|
||||
const dccGatewayLi = document.querySelector(
|
||||
'.wc_payment_method.payment_method_ppcp-credit-card-gateway'
|
||||
);
|
||||
if (dccGatewayLi.style.display === 'none' || dccGatewayLi.style.display === '') {
|
||||
dccGatewayLi.style.display = 'block';
|
||||
}
|
||||
|
||||
const cardFields = paypal.CardFields( {
|
||||
createOrder: contextConfig.createOrder,
|
||||
|
|
|
@ -52,6 +52,12 @@ class HostedFieldsRenderer {
|
|||
if ( hideDccGateway ) {
|
||||
hideDccGateway.parentNode.removeChild( hideDccGateway );
|
||||
}
|
||||
const dccGatewayLi = document.querySelector(
|
||||
'.wc_payment_method.payment_method_ppcp-credit-card-gateway'
|
||||
);
|
||||
if (dccGatewayLi.style.display === 'none' || dccGatewayLi.style.display === '') {
|
||||
dccGatewayLi.style.display = 'block';
|
||||
}
|
||||
|
||||
const cardNumberField = document.querySelector(
|
||||
'#ppcp-credit-card-gateway-card-number'
|
||||
|
|
|
@ -763,11 +763,16 @@ export default class PaymentButton {
|
|||
|
||||
const styleSelector = `style[data-hide-gateway="${ this.methodId }"]`;
|
||||
const wrapperSelector = `#${ this.wrappers.Default }`;
|
||||
const paymentMethodLi = document.querySelector(`.wc_payment_method.payment_method_${ this.methodId }`);
|
||||
|
||||
document
|
||||
.querySelectorAll( styleSelector )
|
||||
.forEach( ( el ) => el.remove() );
|
||||
|
||||
if (paymentMethodLi.style.display === 'none' || paymentMethodLi.style.display === '') {
|
||||
paymentMethodLi.style.display = 'block';
|
||||
}
|
||||
|
||||
document
|
||||
.querySelectorAll( wrapperSelector )
|
||||
.forEach( ( el ) => el.remove() );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue