Upon updating wooCommerce to latest version, the checkout page https://my_website.com/checkout/
now does not submit to the same page (i.e. /checkout/
page) instead it submits to the root url (https://my_website.com/?wc-ajax=checkout)
.
Is there a possible workaround or solution when placing orders to restore the original behavior which is submitting orders to:
(https://my_website.com/checkout/?wc-ajax=checkout)
?
Turns out that the issue is caused by a recent change maid in latest wooCommerce version by using home_page
for all ajax request in the shop.
Workaround:
Restore previous implementation by changing line 35 in includes/class-wc-ajax.php
file ( inside get_endpoint
function):
return esc_url_raw( apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ), home_url( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ), $request ) );