Base path for WooCoomerce ajax calls (wc-ajax)
-
I am struggling to find a way to change the base path for WooCommerce Ajax calls (
wc-ajax
), if it’s even possible. Any API call made on the root path, such as/?wc-ajax=update_order_review
or/?wc-ajax=wc_stripe_get_cart_details
, is causing me issues. I would like to enforce the listener to use a URL with a prefix, like/prefix/?wc-ajax=update_order_review
. Is this even doable? If not, why? I don’t understand why API calls are made against the root path.For clarification:
This issue is causing me problems, as we have an application running in hybrid mode. The entire front-end, CLP views, PDP views, etc., are written separately from WordPress in React. However,
/cart
and checkout should be managed by WooCommerce itself. React is running on the same server as WordPress, and certain paths are subject to proxypass rules in Apache2. Since the homepage (/
) is also subject to proxypass, it is causing the main issues. Proxypass cannot be conditioned based on query parameters, only based on the path; thus, all API calls against the root path end up on the React app instead of WooCommerce. This issue could be easily avoided if the API didn’t listen on/
but on some prefixed path instead.Thanks for any advice.
- The topic ‘Base path for WooCoomerce ajax calls (wc-ajax)’ is closed to new replies.