-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payment form JS isn't loaded at checkout for free orders #326
Comments
Hi @ChaseWiseman. I just happened to post https://wordpress.org/support/topic/2-2-0-please-stop-enqueuing-payment-javascript-sitewide/ yesterday. Your issue description here sounds like it could be related to my concerns, and perhaps could be addressed with this re-arrangement work. Wdyt? EDIT traced my issue to https://github.com/skyverge/wc-plugin-framework/blob/master/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php#L354 |
@lkraav yep I think this would be a good place to look at that as well. One thing about some of these more modern gateways is that they will need to enqueue their scripts on more and more pages outside of checkout as we add things like Apple Pay and express checkout (via PayPal in Braintree's case) since those are to be made available on the single product pages, cart, and even archive pages in the future. But it's still good to keep these concerns in mind and limit things where we can! |
I would love to have a say in the "maybe" decision via |
Added:
|
When an order starts out as free at checkout, core doesn't render the payment methods UI. If the customer updates checkout, like choosing a new shipping method and $$$ needs to be charged, core refreshes checkout and ends up rendering the our gateway payment fields.
However, the way we enqueue the payment form JS handler means it'll only be present on initial page load, and not come along with any AJAX refreshes.
We'll need to change how we enqueue the JS so that it's present in the payment method form UI itself, or figure out some other way to load it on refresh.
The text was updated successfully, but these errors were encountered: