Jump to content

ajax cart block, how to update the entire cart ( which is in the left column ) when adding/deleting/updating a product


ezakimak
 Share

Recommended Posts

Hi , I have modified classes/Product.php in a way that it computes the total quantity of a product considering the product only and not taking into account the attribute (it doesnt matter if the combinations are different ).
It is working as I expect it to , but the ajax code of the blockcart module is not updating the cart properly ( only if I reload the page it updates the cart )
For instance,
A product XXL with various Flavors, I have discounts for qty 2 and qty4 , if I by 2 qty for flavor A and then I buy 2 qty of flavor B I got the discount corresponding to qty 4 as I expected , but in the ajax block cart it shows the correct price only for the last added product, any idea on how to modify the ajax code to update the entire cart when a product is added/deleted/updated ?
I am attaching two images showing the cart before and after the page reload.
As you can see in the first image, the price for the last product correspond to the discount for qty 4, but the price for the first product is still for qty 2.
In the next image you'll see that the prices for both products are all displayed correctly. I thing if I modify the ajax code I could update the price without the need of reloading the page in a way that the final user wont get confused as they are right now.


thanks for any idea


Hugh

Ps 1.3.1

29688_y9wNlsdYn0A11Jzr9llk_t

29689_tMxXXcv5hgZqesumjFRk_t

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More