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

@ -112,6 +112,14 @@ class CardFieldsRenderer {
show(buttonSelector);
if(this.defaultConfig.cart_contains_subscription) {
const saveToAccount = document.querySelector('#wc-ppcp-credit-card-gateway-new-payment-method');
if(saveToAccount) {
saveToAccount.checked = true;
saveToAccount.disabled = true;
}
}
document.querySelector(buttonSelector).addEventListener("click", (event) => {
event.preventDefault();
this.spinner.block();