woocommerce-paypal-payments/modules/ppcp-wc-gateway/resources/js/gateway-settings.js

22 lines
715 B
JavaScript
Raw Normal View History

;document.addEventListener(
'DOMContentLoaded',
() => {
const disabledCheckboxes = document.querySelectorAll(
'.ppcp-disabled-checkbox'
)
function disableAll(nodeList){
nodeList.forEach(node => node.setAttribute('disabled', 'true'))
}
disableAll( disabledCheckboxes )
if(PayPalCommerceGatewaySettings.is_subscriptions_plugin_active !== '1') {
2022-10-31 15:58:19 +04:00
const subscriptionBehaviorWhenVaultFails = document.getElementById('field-subscription_behavior_when_vault_fails');
if (subscriptionBehaviorWhenVaultFails) {
subscriptionBehaviorWhenVaultFails.style.display = 'none'
}
}
}
2021-03-25 17:17:04 +02:00
);