Skip to content
Advertisement

Remove product (item) from WooCommerce checkout page using AJAX

I have added a removal link to the checkout for each product. This part works fine. Problem is; upon removal, the page is “scrolled to top”.

I would like to change this by adding AJAX to the removal process. I’ve tried, but without success. In other words; when clicking on the removal link, the refresh should happen in the background and the customer stays on the same section.

This is the code I am working with:

JavaScript

This is the script which I am not sure how to modify to make this work with a link.

JavaScript

Advertisement

Answer

Your code contains some mistakes.

To remove a product (item) from checkout using AJAX, you can use:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement