Please help, I’m working on a site which can use points to buy products. What I need is to show up in text message when there are not enough points (trying to buy products more than available points). Managed to loop through point table to find all the points available related to logged-in email.
But it’s not working. what am I doing wrong here??
Hi @yisrael-wix
Thanks for the answer and much appreciate if you can help please,
For loop is working and it gives all the earned points(bounty points in the chart) and ID of the email (Login Email in the chart) though actual email is expected.
Above Points table contain earned points and respective email address but when it is console log(useremail) it gives email ID not the email address. so tried to equal usemail and user who logged in to find respective points of the logged in user.
wixData.query( “BountyPoints” )
.find()
.then( function (va){ for ( let i = 0 ; i < va.items.length; i++) {
let points = va.items[i].bountyPoints1;
let useremail = va.items[i].loginEmail;
console.log(useremail) //useremail gives all the email-id not email-address though is should give email address, so useremail===user compaired to find login email in the point table
Result is working (get the total subtotal added to the checkout list)
I have tried to change the user email instead of user id, but it get me undefined in the console log. Really appreciate if you can look into this.