I moved the Woocommerce coupon form by editing the review-order.php
based on this method
I would like to know if it’s possible to make the coupon code apply with AJAX (without reloading the page) like in the cart page. I don’t know where to start, please help.
2
Answers
as per your shared link, if you follow the same means you are using the coupon form inside the checkout form, so you should remove the coupon form tag and then use it.
Copy woocommerce review-order.php and past inside your active then woocommerce folder.
Open review-order.php and past coupon HTML inside table structure like this:
Add jQuery code either your custom.js file or directly on the footer page like this:
As I have tested on my checkout page it’s working perfectly like this:
https://www.loom.com/share/7dfc833895d248f191ba327cf5290403
Optional (if not setup wp_localize_script yet then add into functions.php)
You can modify the snippet below to match your styles.
Place the coupon form below in review-order.php or include it from a separate file
If you want to include it from different file use this
Add your ajax handler with the coupon logic in your function.php