bigsy85
11-09-2010, 10:22 PM
Hi,
I have multiple forms on a page that I submit using ajax, it send a product_id so it knows which one to update, with limitations out of my control it regenerates a new product_id for the product just updated.
The problem I have is if a user is updating a product in their basket, it updates each product, but when they make a second alteration to the product without a page refresh which I want to avoid it does not update the product because the product id has changed.
During the update of a product once the new product id is generated it places it into $_SESSION['new_products_id_in_cart'] = $products_id;
What I need to do is once my form is submitted with Ajax, to return that session variable and place the result of this into an input box, ready for the next time the for is updated.
At the moment I'm using Jquery Form to handle Ajax requests, but can change that if needed.
I really hope someone can help, if you don't quite understand please let me know.
Thank!
I have multiple forms on a page that I submit using ajax, it send a product_id so it knows which one to update, with limitations out of my control it regenerates a new product_id for the product just updated.
The problem I have is if a user is updating a product in their basket, it updates each product, but when they make a second alteration to the product without a page refresh which I want to avoid it does not update the product because the product id has changed.
During the update of a product once the new product id is generated it places it into $_SESSION['new_products_id_in_cart'] = $products_id;
What I need to do is once my form is submitted with Ajax, to return that session variable and place the result of this into an input box, ready for the next time the for is updated.
At the moment I'm using Jquery Form to handle Ajax requests, but can change that if needed.
I really hope someone can help, if you don't quite understand please let me know.
Thank!