Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

JavaScript Is prestashop.on synchronous?

JosiahMaybe

Platinum Coder
Javascript events
I found that for Javascript events.
If I do prestashop.on with checkoutChangedStep will it be before event, submission, like my code, then maybe checkout change step with not checkout change step before prestashop.on ends?
Can I reject by reloading or loading an external page with that?

If not that reject and other yes then I may use updateCart.
For that I would use make document.body hidden, like my code, if success unhide document.body and let user continue. For rejection, make document.body.innerHTML a new message and show document.body.
Should any of that work?

I need no possibility of a payment with rejection and to not have cart items stay in cart upon rejection.
Mostly just need no possibility of paying for an item upon one rejection, I may always have like my Javascript code in PrestaShop so for rejection I may have a localStorage saved thing for reject upon load if set to false and no check needed if set to true.

This seems like it should work but does it?
X E.
 
Javascript events
I found that for Javascript events.
If I do prestashop.on with checkoutChangedStep will it be before event, submission, like my code, then maybe checkout change step with not checkout change step before prestashop.on ends?
Can I reject by reloading or loading an external page with that?

If not that reject and other yes then I may use updateCart.
For that I would use make document.body hidden, like my code, if success unhide document.body and let user continue. For rejection, make document.body.innerHTML a new message and show document.body.
Should any of that work?

I need no possibility of a payment with rejection and to not have cart items stay in cart upon rejection.
Mostly just need no possibility of paying for an item upon one rejection, I may always have like my Javascript code in PrestaShop so for rejection I may have a localStorage saved thing for reject upon load if set to false and no check needed if set to true.

This seems like it should work but does it?
X E.
To answer your question,
A bit hard to determine without proper documentation and examples. Best would be to run and see if all data is received before the function has finished running.
 
I was trying to find if this should work before I buy something, but thanks and I am almost certain that one of these methods will work, but wanted confirmation from someone with a store if I could. I understand that there is no official documentation on some of this and I have asked in a PrestaShop forum, no return yet.

Based on what I know it should work but if you know anyone with a store who could help or how to ask someone would be great.
This is for a custom country check using weatherapi.com.
What more info do you want? Maybe specifically?
Anyway, I am mostly interested in how to reject with this.

I know of some shops powered by PrestaShop but am unsure what to do with that.
Maybe I should ask permission on an in testing store and use developer console in like my browser to test this or something.
There are some of those on PrestaShop forums.
X E.
 
I was trying to find if this should work before I buy something, but thanks and I am almost certain that one of these methods will work, but wanted confirmation from someone with a store if I could. I understand that there is no official documentation on some of this and I have asked in a PrestaShop forum, no return yet.

Based on what I know it should work but if you know anyone with a store who could help or how to ask someone would be great.
This is for a custom country check using weatherapi.com.
What more info do you want? Maybe specifically?
Anyway, I am mostly interested in how to reject with this.

I know of some shops powered by PrestaShop but am unsure what to do with that.
Maybe I should ask permission on an in testing store and use developer console in like my browser to test this or something.
There are some of those on PrestaShop forums.
X E.
I highly doubt anyone with a shop will give anyone permission to test, unless you are either one of their devs, or doing pentesting. What I encourage you to do is start your own test shop and work on the theme to test things out
 
Worth a shot to ask though, and thank you. Should I accept that or wait until I have an answer from like my testing?
Also, I have found IONOS currently could allow that for $6 for first 6 months so even if I can't get this free I can get this cheap.
There are also free PrestaShop hosting things I found. Like my only hold up is I only get one shot like is and I try not to waste anything. X E.
 
Back
Top Bottom