Skip to content
Advertisement

update_order_review( ) on button click

I have a custom button on my checkout page, on click I’m adding a product to cart via AJAX.

JS:

JavaScript

PHP:

JavaScript

After that, I’d need to refresh the order review, so it displays my newly added product also. How can I do that?

Advertisement

Answer

All you need to do is call a trigger on the body to update the cart.

JavaScript

This will automatically call all the subsequent AJAX calls needed to refresh the cart information, including the order review.

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