mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Disable save to account checkout if subscription in the cart
This commit is contained in:
parent
cd8cfaf0b8
commit
51aa79af11
4 changed files with 29 additions and 12 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue