ha… you are right!!! //obviously
Yes. The button now works for the other two plans.
Can you point me where to look for that extra logic?
Never done that before
ha… you are right!!! //obviously
Yes. The button now works for the other two plans.
Can you point me where to look for that extra logic?
Never done that before
BTW… Not sure how to point from the lightbox confirm to the paying section…
I mean to this one:
And the free section…
Check here:
how can I “call” the alert message into the purchasing process? on the item page, I mean.
Hi @darak , its me again
I was going over the code and it reads this:
// The PlanEvents collection has a title field, // in which we insert the type of transaction. // The collection also has a data field, // where we will insert information about the order// from the event's order object (json).
if (event.order.price.amount === 0) {
let orderData = { "title": "Free plan purchased", "data": event.order }; wixData.insert("PlanEvents", orderData);
} else
{ let orderData = { "title": "Regular plan purchased", "data": event.order }; wixData.insert("PlanEvents", orderData); } }
Shouldn’t it write the free plan purchased on the Plan Events collection?
Hi @darak
I’ve got another question:
Where do you edit this page so it matches the collection and repeater page url?
BTW, you can check right now that I have collapsed the “plans widget” in order to make it become the default “plans page”, but now I miss all other information that should display on that same widget.
how are you handling this?
another issue Im finding…
Here is how the story should go:
Purchase plan - then lightbox for purchase - then this page
whats happening right now (even with a purchase) is :
signup form - then lightbox - then this page:
There is no place where I can set my paying options.
I’ve tried deleting the member and contact to leave no trace of any of the information.
Because I need the users to accept some terms before purchasing the plan I’ve added a subscription form with conditional (once the checkbox is checked then show the btn)
Is there a way to this without extending the purchase process?
Currently the setting is pay offline.
The checkout btn inside the lightbox was going to:
If you enter through here:
https://www.elruralnetwork.com/plans-pricing
It will give you the first option.
Yet if you do from the “collection and repeater page”, it doesn’t let you perform the purchase.
Ive tried this on the “confirm” lightbox :
import wixPaidPlans from 'wix-paid-plans';
import wixPay from 'wix-paid-plans';
let planId = '3c75b146-fb7b-4881-8a9a-a4ecb1ab6dfa'
export function myPurchaseButton_click(event) {
wixPaidPlans.purchasePlan(planId)
.then( (myPurchase) => {
let myOrderId = myPurchase.orderId;
let myWixPayOrderId = myPurchase.wixPayOrderId;
let myWixPayStatus = myPurchase.wixPayStatus;
} );
}
And it takes me to…
But… what about if I have two ids that I should include?
Would another - let planId2 = ‘xxxxx’ – do the trick?
I don’t think this can solve the issue…
BTW… I’ve checked the live Plan events, and it only registers free purchases, no paid plan has been registered.
Thank you @Dara for helping me sort this out!
Hey Iz,
Yeah it looks like that tutorial isn’t complete. It’s supposed to bring up the checkout for your users to enter their payment details when they click confirm on the lightbox but doesn’t look like the code for this was added to the tutorial. I’ll make sure we get this updated. For now, you can try this;
export function Yes_click(event) {
wixWindow.lightbox.close({
“goForIt” : true ,
‘wixPayOrderId’ : received.wixPayOrderId
})
}
export function No_click(event) {
wixWindow.lightbox.close({})
}
if (myPrice > 0 ) {
wixPaidPlans.orderPlan(myId).then(orderObject => {
wixWindow.openLightbox( “Confirm” , orderObject)
.then((res) => {
if (res.goForIt) {
wixPay.startPayment(res.wixPayOrderId);
}
});
})
} else {
wixPaidPlans.orderPlan(myId).then(orderObject => {
wixWindow.openLightbox( “Congrats” , orderObject);
})
}
}
For the extra bit of code when a user already has a plan, you won’t find it anywhere you’ll have to write it.
You can use the getCurrentMemberOrders() function to get which plans your users are already signed up for and then show a certain message for users that are already signed up. Check out an example of how to go about it in this post .
Thanks @darak ! I thought I was missing something. Have you been able to check the previous issues I am encountering?
Hi @darak !
These are the issues I mentioned down the conversation.
@hola95401 The easiest way to display the warning message about only being able to purchase the plan once on the item page would be to add a field to the testimonials collection to indicate whether the plan is single purchase only or not.
Then add a text element displaying the message you want and set it to hide/show depending on the plan being viewed and if it’s single purchase.
Similar to this tutorial .
You can edit page URLs in the page settings.
If you collapsed the paid plans widget and are missing information from it that you would like to display you will just have to add a dataset connected to that collection and connect elements to whatever it is you want to display.
Ok great!!! I guess I can make that work!
I’ll be working on it.
BTW, I’ve just tried the code sample you shared and I am having issues with the “received”
$w.onReady( function () {
received = wixWindow.lightbox.getContext();
});
It appears:
Not sure where to place this code… I’ve tried it on both lightbox and item and still displays the same message.
Hey, sorry.
Just change that to " let received = wixWindow.lightbox.getContext()" and you’ll stop getting that error.
i Dont think I’m getting the logic right… what am I missing?
$w.onReady( function () {
$w( ‘#buyNow’ ).onClick((event) => {
wixPaidPlans.getCurrentMemberOrders()
.then((orders) => {
if ( ‘currentPlanObject._id’ === orders ) {
$w( “#recuerdo” ).show();
} else {
console.log( “No tiene Plan” )
}
hummm not sure whats happening…
@darak Thank you very much for your patience!
I really appreciate your advice.
"You can edit page URLs in the page settings.
If you collapsed the paid plans widget and are missing information from it that you would like to display you will just have to add a dataset connected to that collection and connect elements to whatever it is you want to display. "
I had to collapse the paid plans widget so I could display the pricing page we have been working on. The issue is that whats included is content (yes attached to a dataset), not a widget, So I cannot change what is displayed according to which page the user comes from.
Not sure if Im expressing myself correctly, English as a second language…
Let me know if there is a way around this please.
Hey Iz,
Take the “let received” line out of the onReady and add it to the start of the onClick() event, it’s just not picking it up the variable because they’re in separate functions. That’s my bad.
I just tested with the getCurrentMemberOrders() function too and was having trouble setting it up.
Should be much easier using the getPricingPlans() function from wix-users. Something like this:
let user = wixUsers.currentUser
user.getPricingPlans()
.then((pricingPlans) =>{
console.log(pricingPlans)
let planName = pricingPlans[ 0 ].name
if (planName === currentPlanObject.name){
console.log( “You already have this plan” )
} else {
console.log( “You do not have this plan already” )
}
})
Not sure whats going now…
Could you check on your side whats happening here?
https://www.elruralnetwork.com/plans/super-co-test
Why the lightbox isnt opening?
And…
I have “uncollapsed” the Pricing widget from the “pricing-plans” URL,and not sure why… but the select plan buttons are not taking you anywhere…
Even though you are a connected or not connected member,
chaos over here
And here:
The button isn’t taking anywhere,not even to 404 - how come?
Right now Im trying to uninstall and reinstall the pricing plan app… and it seems impossible!
hi @darak !
Sorry to bug you, but have you been able to take a look at the issues?
Yesterday the editor had tons of saving errors going on. Error messages were popping up every 20 minutes or so.
Let me walk you through the issues:
I have now two pages for plans.
the collection one - the one we have been working on with the repeater and the plan item. url/collection-and-repeater
the original pricing one (so I don’t miss the message of “Esta página está disponible solo para suscriptores” information). Includes the widget
url/plans-pricing
I register as a new member (totally free, no plan acquired)
I navigate to a page just for members. This message appears:
Issue 1 - I try to click on “Ver planes” but nothing happens.
Issue 2: Same issue here:
As I can’t remove the links, the least I can do is make them work so it provides a better UX.
Lets go through the purchasing process:
On the https://www.elruralnetwork.com/collection-and-repeater
and the link doesn’t work. I mean, you can click it a thousand times and it won’t trigger anything.
@darak Could you help me sort out these linking issues from the widgets so I can close this task?
Thanks a ton!!!
Hey Iz,
The member pages are set so that only members with certain plans can access them.
It’s expected that the error message about online payments will pop up if you have not set any payment providers on the site yet.
This forum is specifically for questions about/issues using Velo. If you are having issues with the Pricing Plans app/widgets themselves you will have to contact Wix support for assistance with that.
@darak , yes I am aware that I have set member online pages permissions
Its just that since i have made those changes on the pricing plans, the default buttons on the pricing widget have stopped working (the ones Ive share on my previous message) so i’m not sure if it has something to do with it, if this is something I can solve on my side or if I should contact wix support.
Would you be so kind to clarify who should I address regarding the widgets links not working?
Thank you!