Paid Plans

@antanasd Yes thank you for all of this. I have implemented everything here a few months back, including light box popups to ask if the user is “sure”. I use a repeater to show all active plans for the user. The last remaining item is recently introduced:

  1. Once you start saving members’ orders data you’ll have the necessary information to be able to allow them to cancel their orders. Cancellation can be done calling .cancelOrder method ( https://www.wix.com/corvid/reference/draft/wix-paid-plans.html#cancelOrder ) which takes orderId (which you are saving to your DB dataset (field " “orderId”: purchaseResponse.orderId " in the previous example)).

This is what I was waiting for. Thank you very much. The last time I looked at Corvid “cancelOrder” was not an available function.

I answered my own question, the two purchasePlanResult.orderId and the purchase plan event.order.id are one in the same.

This is my approach on my members subscription page:

if (results.cancel) {
console.log(“Subscription Cancelled”)

            $item("#cancel").disable(); 

            wixPaidPlans.cancelOrder(data.orderId).then(() => { 
                $item("#cancel").label = cancelled; // Label in the repeater now says "Cancelled" 
                updateSubStatus(data, cancelled); // update the "Subscriptions" database 
                sendFormData(data, cancelled); 
            }) 
            . **catch** ( (err) => { 
                $item("#cancel").label = pendingCancel; // There was an error 
                updateSubStatus(data, pendingCancel); // update the "Subscriptions" database 
                sendFormData(data, pendingCancel); 
            }); 
        } 

“sendFormData” is something sends out a sendGrid.js email to the admin email notifying of a plan cancellation.

I have an automated workflow for all “Member cancelled a plan” will this wixPaidPlans.cancel() be caught there as well?

This was a great addition to the corvid tools thank you sorry I talk so much!!!

@antanasd Great you guys openend up the cancelOrder API!

In your example, is there a reason for using the purchasePlan() function over the onPlanPurchased() event-listener? https://www.wix.com/corvid/reference/draft/wix-paid-plans-backend.Events.html#onPlanPurchased

@hbierlee the backend event listener is superior for dumping data into your database. This is what I use.

@hbierlee Hello. You can actually use both purchasePlan() and onPlanPurchased() event-listener for saving the data on order cancelation. The main difference would be the data you have at the moment of saving - onPlanPurchased() event returns you Order https://www.wix.com/corvid/reference/draft/wix-paid-plans-backend.Events.html#Order , while in the example we are saving data to the subscriptions entity on plan’s purchase and since we do it in the repeater connected to the Plans dataset we have both the whole Plan ( const plan = $w(“#dynamicDataset”).getCurrentItem()) with e.g. plan’s name and Order.

@brygidap I see! I agree that’s a convenient benefit, but I’d still argue for the use of the event-listener as you should be able to fetch the plan details from the back-end with the planId in the Order object. The benefit of the event-listener is that it will catch all order-events (in case there are ways/extra buttons on your site to purchase plans on your website that you didn’t also link to your custom purchasePlan() or orderPlan() callbacks). Both methods will work, though.

Paid Plan Elements/Widgets would be great to put across sites or at least have more display options and flexibility on the paid plans specific page - to make it clearer (and for several other reasons!). I have voted for the element feature but it took years for a simple terms and conditions checkbox to come out on bookings forms so I’m not hoping for much… :frowning:

@Antanas Dapkus any update on the My Plan Feature?

Also any plans to integrate Plans and Stores? I sell both on my site, and from a users perspective they are the same. I’d like them to be able to add plans to their cart, and checkout the whole lot at the same time. I don’t see a way to do this, but please let me know if there is. Thanks

We are working on it. It should be released in couple of months.

We will release Store Subscriptions. You will be able to sell a product on a recurring schedule.

Cart will not hold Pricing Plans and Store subscriptions, users will have to purchase it seperatly.

@Antanas Dapkus
When using the plans with booking, there is very very annoying glitch that makes things very complicated.
For example when booking a session,

session page> book > choose the date > payment > pricing plans payment option > go to the page showing 2 pricing plans available for this session > choose 1 of the 2 plans >

and here is the problem,
when you select 1 of the available plans from the plan page, instead of going forward to the payment page , it redirects you to the FULL list of all pricing plans available on the website (or pricing plan page) in this case 10 differents plans (those 2 + unrelated others 8 )

So now the customer has to find AGAIN the plan he ALREADY selected, for no apparent reason, in the midst of all those differents and unrelated plans…

So, everything works fine until you select your plan, then BAM back to a pricing plan page. So, it looks like a bug … in this case a very problematic one that makes thoses great feautures virtually unusable.

If you or somebody could check the code, that would be super great !!
MAny thanks

@antanasd
When using the plans with booking, there is very very annoying glitch that makes things very complicated.

For example when booking a session,

session page> book > choose the date > payment > pricing plans payment option > go to the page showing 2 pricing plans available for this session > choose 1 of the 2 plans >
and here is the problem,
when you select 1 of the available plans from the plan page, instead of going forward to the payment page , it redirects you to the FULL list of all pricing plans available on the website (or pricing plan page) in this case 10 differents plans (those 2 + unrelated others 8 )

So now the customer has to find AGAIN the plan he ALREADY selected, for no apparent reason, in the midst of all those differents and unrelated plans… So, everything works fine until you select your plan, then BAM back to a pricing plan page.
So, it looks like a bug …
in this case a very problematic one that makes thoses great feautures virtually unusable. If you or somebody could check the code, that would be super great !! MAny thanks