mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Prevent enabling Standard Card Button when ACDC is enabled
This commit is contained in:
parent
36a13f6500
commit
49faab654a
3 changed files with 44 additions and 9 deletions
|
@ -125,10 +125,6 @@ document.addEventListener(
|
|||
}
|
||||
|
||||
function shouldDisableCardButton() {
|
||||
if (currentTabId() === 'ppcp-card-button-gateway') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return PayPalCommerceGatewaySettings.is_acdc_enabled || jQuery('#ppcp-allow_card_button_gateway').is(':checked');
|
||||
}
|
||||
|
||||
|
@ -157,6 +153,11 @@ document.addEventListener(
|
|||
}
|
||||
|
||||
if (shouldDisableCardButton()) {
|
||||
const standardCardButtonInput = document.querySelector('#woocommerce_ppcp-card-button-gateway_enabled');
|
||||
if (standardCardButtonInput) {
|
||||
standardCardButtonInput.disabled = true;
|
||||
}
|
||||
|
||||
disabledSources = disabledSources.concat('card');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue