Preventing redirect after onCheckoutSuccess in WooCommerce Blocks checkout
Hi,
We are currently developing a payment gateway plugin and have successfully made it compatible with WooCommerce Blocks for the new checkout experience. Our payment process is designed to operate within an iFrame to ensure a seamless user experience.
With the standard WooCommerce checkout, we manage the payment flow and prevent automatic redirection after payment by hooking into the ‘checkout_place_order_success’ event. However, when adapting our plugin to work with WooCommerce Blocks, we encountered a challenge with the onCheckoutSuccess
event.
In the context of WooCommerce Blocks, once the onCheckoutSuccess
event is fired, WooCommerce proceeds with a redirection to the specified redirect_url
. We aim to interrupt this redirect to retain users within the iFrame until the payment process is fully complete and controlled by our plugin logic.
Here are the specifics of our implementation challenge:
- We have successfully intercepted the
onCheckoutSuccess
event within our React component. - Despite our interventions, we cannot seem to prevent WooCommerce from executing the default redirection to
redirect_url
after the event completes.
Our primary question is: Is there a supported method or recommended approach within WooCommerce Blocks to prevent or override this automatic redirection upon successful checkout within the context of an iFrame payment process?
Any insights, documentation references, or examples would be greatly appreciated as we aim to ensure compatibility and a smooth user experience with WooCommerce Blocks.
Thank you in advance for your support and guidance.
The page I need help with: [log in to see the link]
مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد
منبع: انجمن وردپرس