Disable save to account checkout if subscription in the cart

This commit is contained in:
Emili Castells Guasch 2024-01-11 12:29:36 +01:00
parent cd8cfaf0b8
commit 51aa79af11
4 changed files with 29 additions and 12 deletions

View file

@ -28,6 +28,14 @@ document.addEventListener(
init()
});
if(ppcp_add_payment_method.is_subscription_change_payment_page) {
const saveToAccount = document.querySelector('#wc-ppcp-credit-card-gateway-new-payment-method');
if(saveToAccount) {
saveToAccount.checked = true;
saveToAccount.disabled = true;
}
}
setTimeout(() => {
loadScript({
clientId: ppcp_add_payment_method.client_id,