Hi all,
On my site I have set up pricing plans and want to make it so that users can only have one at a time. I don’t think that there is a native feature for this so I tried to achieve it with code, here is where I’m at.
export function myChangeStartDateFunction() {
orders.listCurrentMemberOrders({orderStatuses:[“ACTIVE”]}).then((order) => {
checkout.changeStartDate(1, order[0].endDate);
});
}
This code runs whenever the checkout window is opened and will change the start date of the plan the user is ordering to the end date of their current plan. The issue is that I have recurring payments set up which means the endDate doesn’t actually work. I need it so that the plan they are about to buy will only become active once their other plans are finished. Is there any other way to make this kind of feature? Would I have to do something like pausing the plan until the other ends? What would be the best way to do this