I'd like to have a shopping cart/basket integrated into my navigation (the actual cart, not just the number of items).
I can get the cart to display fine, but if I'm on a product page and add to cart, I'd like to have the cart updated automatically (currently it will only update on a refresh or navigating to a different page).
Along the same lines, I'd love to remove an item by clicking on the remove button without a direct post action to the browser.
Does anyone have an idea on how to implement this type of behavior (if it is possible)?
Update Cart/Basket through ajax when adding an item
I'd like to have a shopping cart/basket integrated into my navigation (the actual cart, not just the number of items).
I can get the cart to display fine, but if I'm on a product page and add to cart, I'd like to have the cart updated automatically (currently it will only update on a refresh or navigating to a different page).
Along the same lines, I'd love to remove an item by clicking on the remove button without a direct post action to the browser.
Does anyone have an idea on how to implement this type of behavior (if it is possible)?
Thanks!
You could have a controller action called DisplayCart, which gets the cart after adding it
something like: Clicks on add to cart Ajax adds to cart => using a callback => Ajax getCart
that way you get a refreshed cart
Same applies to remove from cart
is working on a reply...