Only display buttons in checkout if guest with subscription

This commit is contained in:
dinamiko 2022-01-17 14:35:25 +01:00
parent dce8a06953
commit 2f78bab9ca
2 changed files with 14 additions and 5 deletions

View file

@ -82,8 +82,16 @@ document.addEventListener(
console.error('PayPal button could not be configured.');
return;
}
const script = document.createElement('script');
if (
PayPalCommerceGateway.context !== 'checkout'
&& PayPalCommerceGateway.data_client_id.user === 0
&& PayPalCommerceGateway.data_client_id.has_subscriptions
) {
return;
}
const script = document.createElement('script');
script.addEventListener('load', (event) => {
bootstrap();
});