Add variable subscription variation support for cart block page

This commit is contained in:
Emili Castells Guasch 2024-04-15 11:05:01 +02:00
parent e1486deff8
commit 561cafb808

View file

@ -120,8 +120,13 @@ const PayPalComponent = ({
};
const createSubscription = async (data, actions) => {
let planId = config.scriptData.subscription_plan_id;
if (config.scriptData.variable_paypal_subscription_variation_from_cart !== '') {
planId = config.scriptData.variable_paypal_subscription_variation_from_cart;
}
return actions.subscription.create({
'plan_id': config.scriptData.subscription_plan_id
'plan_id': planId
});
};