Display repeater data based on logged in member price plan

@arjunchahal Your dedication inspires me. :grinning:

Ok, I think we have reached a point where back-n-forth messages won’t be efficient to assist you. How about you email me and we hop on a short video call so I can assist you and explain?

@code-queen Thanks so much…that would be amazing. And I just want to reiterate that I truly do appreciate all your help through this.

Where exactly do I email you though? Your contact info on the wix profile and your websites do not seem to have an email address listed.

Anyways to avoid more back n forth, feel free to email me here (info@ionicbridge.com) or just let me know where I can email you :slight_smile:

@arjunchahal @lmeyer Have you guys found an answer for this? I have set everything up and I can get the data to insert into the Purcahses Database (I have checked my code x 3). N.B. My Purchases database is call PaidMemberPlans

Here is my code to insert:
import wixData from ā€˜wix-data’ ;

export function wixPaidPlans_onPlanPurchased(event) {

if (event.order.price.amount === 0 ) {
let orderData = {
ā€œtitleā€ : ā€œFree plan purchasedā€ ,
ā€œdataā€ : event.order
};
wixData.insert( ā€œPaidMemberPlansā€ , orderData);

} else {
let orderData = {
ā€œtitleā€ : ā€œRegular plan purchasedā€ ,
ā€œdataā€ : event.order
};
wixData.insert( ā€œPaidMemberPlansā€ , orderData);
}
}

Did this end up working for you?

I’m looking to do something similar. Only i’m not allowing my users to ā€œpurchaseā€ their plan via the website. I plan on adding the plan to their account via the Wix dashboard. So there’s no front-end trigger to add this record into the custom database (Puchases). Is there a way to automate it without the front-end piece? If i can automatically populate a database with user ID, their assigned plan ID and plan name, i can then use this database to filter my repeater’s dataset. My repeater’s dataset would have a field for each product tagged with the specific pricing plan so only users with that pricing plan can see specific products.

Another thought i had was around the Subscriptions database. There isn’t one that we can see in the database collections. But the website somehow queries each user’s subscription plan when it shows it in their Member’s area. So each user’s pricing plan is stored somewhere. Is there a way to query that onReady? If yes, then technically we can filter repeater’s dataset using each user’s Pricing Plan name/id…

Does anyone have any ideas on how to make this work? My coding skills are amateur at best :frowning:

@arjunchahal @code-queen Did you guys ever get this figured out? I’m at the exact point where you two broke off to speak offline. I’m having the broken links problem in my Purchases database, and it sounds like I need to do a dataInsert into my customPlans dataset, but I’m not sure what page to do that on and I’m thinking that will create a bunch of redundant records in my customPlans dataset. How did you guys get beyond the broken references in the planID reference field?