Answer the question
In order to leave comments, you need to log in
How to fix Ajax Smarty fetch?
Ajax cart script in simpla cms.
-Ajax I send the quantity of goods
-I send everything to php to change the session of the basket
-In response I return the necessary pieces to replace in html
And everything would be fine, but the tpl that I take through fetch does not return correctly.
The answer always comes, all the pieces are correct, but here is the fetch (cart_purchases.tpl) moments from previous requests. It's like it hasn't been updated. The feeling that this template does not have time to be generated and the previous version is given. I reset the variable in which I put the template - it did not help.
Changed server, hosting did not help. On one, everything worked properly, only the script execution delay increased.
If I make a delay after calling the template, it works properly.
How to force php or Smarty to accurately load the current, updated tpl?
Answer the question
In order to leave comments, you need to log in
I put a clean simplu with the same template - the issue was resolved.
Let me remind you ajax -> php -> smarty fetch cart_purchases.tpl
A few interesting observations on different servers, hostings:
1. The script is executed instantly, but fetch cart_purchases.tpl often gives incorrect results from the previous execution.
2. The script is executed slowly, unrolling, on one request and exactly as needed.
Simpla was modified, which made the bug incomprehensible.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question