Page 1 of 1

How: Add Ajax delete from cart button

Posted: 25 Sep 2018, 14:21
by maintainthedomain
Hi great phoca people!

I could manage to add a delete button to the cart module. I just copied the form and button from cart_checkout.php to cart_cart.php and set the task to checkout.update.

Now, of course every time an article is deleted the page refreshes, as this is I guess necessary for checkout view.

How can we make this an Ajax delete button??

Thanks in advance!

Re: How: Add Ajax delete from cart button

Posted: 29 Sep 2018, 11:47
by Jan
Hi, there is no problem to make the delete button as AJAX, the problem is when you delete some item from the cart, then everything changes:

- product discount, cart discount, coupons must be recalculated - because there are rules based on count of items or sum of items
- shipping method needs to be reset - because rules are based on sum or another rules
- payment method needs to be reset - the same like shipping method.

So when removing item from the cart, not only the whole checkout page must be refreshed but even the module cart. So this is why whole site is refreshed, because with deleteing everything changes.

Jan