I have created a web page where the user can register and then edit their profile. You can add a photo if you want.
Any questions or suggestions will be well received
try the site click here: https://goo.gl/6SzfnW
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
Can you share the code you used? Im trying to figurer out whats wrong with my code.
I have a site that should require users to pay a subscription fee. So at first I just want to set some things:
1) I want to create a member profile page.
2) I want the login button to run a query that looks for a user ID in the collection I've created.
3) I want to redirect the users by their position: if the user exists in the payed members collection he needs to be redirected to a specific page. And if the users does not exists in the collection he needs to be redirected to the purchase page.
when Im clicking the login button I created nothing happens and it says I have a problem in my code.
the code Ive used:
-------------------------------
import wixUsers from 'wix-users';
import wixData from 'wix-data';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
export function profileButton_click(event) {
wixLocation.to(`/PaidMembers/${wixUsers.currentUser.id}`);
}
export function loginbutton_click(event) {
// user is logged in
if (wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then(() => {
// update buttons accordingly
$w("#loginButton").label = "Login";
$w("#profileButton").hide();
});
}
// user is logged out
else {
let userId;
let userEmail;
// prompt the user to log in
wixUsers.promptLogin({
"mode": "login"
})
.then((user) => {
userId = user.id;
return user.getEmail();
})
.then((email) => {
// check if there is a match for the user in the collection
userEmail = email;
return wixData.query("PaidMembers")
.eq("_id", userId)
.find();
})
.then((results) => {
// if an item for the user is not found
if (results.items.length === 0) {
// redirect to pay for subscription
wixLocation.to("/store");
}
// if there is a match redirect to lessons page
else {
wixLocation.to("/arabiclessons");
} );
Thanks!