woocommerce-paypal-payments/modules/ppcp-blocks/resources/js/Helper/Subscription.js

19 lines
430 B
JavaScript
Raw Normal View History

/**
* @param {Object} scriptData
2024-07-12 12:58:34 +02:00
* @return {boolean}
*/
2024-07-12 12:58:34 +02:00
export const isPayPalSubscription = ( scriptData ) => {
return (
scriptData.data_client_id.has_subscriptions &&
scriptData.data_client_id.paypal_subscriptions_enabled
);
};
/**
* @param {Object} scriptData
2024-07-12 12:58:34 +02:00
* @return {boolean}
*/
2024-07-12 12:58:34 +02:00
export const cartHasSubscriptionProducts = ( scriptData ) => {
return !! scriptData?.locations_with_subscription_product?.cart;
};