I would to adding a conditions & terms on before a user would signup on my wix website inside their code interpreter. But when i put the code it show me a verbose error for my variable accept
from one modal to another i think it doesn't working maybe i missing import or something else on their API:
https://www.wix.com/velo/reference/wix-window/openlightbox
I have 2 lightbox (modal) :
Sign up modal box
import wixWindow from 'wix-window';
import wixUsers from 'wix-users';
import window from 'wix-window';
import wixUsersBackend from 'wix-users-backend';
let email
let password
//...Enter his email & password
wixUsers.register(email, password) // add email & password to database
.then( (result) => {
wixWindow.openLightbox("Conditions générales de vente"); // after adding to DB, displaying "condition & terms" modal(lightbox)
if(accept.clicked == true); // if user accecpt terms...
let status = result.status; // ..."Pending" the result
else{
let user = wixUsersBackend.currentUser;
wixUsersBackend.deleteUser(user .id) // delete the current user registration on DB
}
} );
Condition & terms
import wixLocation from 'wix-location';
import window from 'wix-window';
import wixWindow from 'wix-window';
$w.onReady(function () {
$w('#button1').onClick(() => {
let accept // button have "accept" variable
wixLocation.to("/home"); // redirect to home page
});
$w('#button2').onClick(() => {
window.lightbox.close();
});
});
I missing something in the script? Could anyone help me with this.
Aucun commentaire:
Enregistrer un commentaire