mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Ensure save payment method when subscription in cart
This commit is contained in:
parent
120e76b46a
commit
ebccacf964
2 changed files with 8 additions and 1 deletions
|
@ -25,6 +25,14 @@ export function CardFields({config, eventRegistration, emitResponse, components}
|
|||
}
|
||||
|
||||
const hasSubscriptionProducts = cartHasSubscriptionProducts(config.scriptData);
|
||||
useEffect(() => {
|
||||
localStorage.removeItem('ppcp-save-card-payment');
|
||||
|
||||
if(hasSubscriptionProducts) {
|
||||
localStorage.setItem('ppcp-save-card-payment', 'true');
|
||||
}
|
||||
|
||||
}, [hasSubscriptionProducts])
|
||||
|
||||
useEffect(
|
||||
() =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue