Compatibility with Fluid Checkout
-
Hi there,
I’m Diego, developer of Fluid Checkout, a multi-step checkout plugin for WooCommerce available on the www.ads-software.com Directory:
https://www.ads-software.com/plugins/fluid-checkoutSome users are having issues with the PayPal buttons not working properly when using our plugin. Sometimes, and especially on mobile devices, the PayPal secure popup will not open or close suddenly after clicking the PayPal button to complete the payment.
It seems to work all fine with the Express Checkout buttons for PayPal.
After through analysis of the code, this problem seems related to the fact that our plugin replaces parts of the checkout page via AJAX calls (
update_checkout
event) whenever the customer leaves the page (windowunload
event), or changes the active browser tab or app on the phone (documentvisibilitychange
event).These requests have the purpose to to save the information provided by the user and prevent them from accidentally losing it.
When the PayPal popup window/tab is openend after clicking the button, this will trigger Fluid Checkout to refresh the checkout page parts while the main checkout page is in the background. If the checkout refresh happens before the PayPal window/tab is opened and loaded, the PayPal window will not open or will close suddenly because some part of the checkout page was refreshed and the PayPal script will abort.
To fix this issue, we need to prevent Fluid Checkout from updating the checkout parts when the PayPal button is clicked and the secure popup is loading or is being used.
We’ll make the necessary changes to our plugin, however, we are struggling with detecting when the PayPal buttons are clicked or the secure popup is closed.
- Is there a way to detect when the PayPal buttons have been clicked? A JS event perhaps?
- Also, how can we detect when the PayPal window has been closed?
Our plans are to set the global JS variable
window.can_update_checkout = false
, which is used to permit checkout updates when the button is clicked, then reset it to the original value when the PayPal popup is closed for one reason or another (because the customer closed it, cancelled the PayPal payment, or because the payment was successful).Best,
Diego.
- The topic ‘Compatibility with Fluid Checkout’ is closed to new replies.