Jump to content

Payload AJAX after submit a form


Recommended Posts

On 11/10/2018 at 10:03 AM, Rolige said:

Hello:

What do you need to prevent? If you just want to return a json you must use ajax=1 param in the request to indicate Prestashop controller that what kind of method will process the request and how will be the response.

Regards

I need respond that query(Form submit) also I want to use Token for avoid rapid fire, because getToken from Tools Class creates the same token everytime and Token is present in header, so every time if I don't use die, payload comes with new instance of the same page(HTML).

Response:

image.thumb.png.0db21770c66fecab0d81d567634993b5.png

PHP Code:

image.thumb.png.6a2468be2380f2e99d915c2a4f2ef2f4.png

Edited by PMunoz92 (see edit history)
Link to comment
Share on other sites

1 hour ago, Inform-All said:

I'm not sure what you are trying to achieve. But i would recommend making a override in which you extend the display.php. Please explain a bit more in what you are trying to achieve.

after submit, variables are rewrote, I mean, after submit, PHP Script execute again

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...