mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
✨ Always load GooglePay scripts on checkout page
This commit is contained in:
parent
15a09d9722
commit
07c73985e3
1 changed files with 9 additions and 5 deletions
|
@ -94,16 +94,20 @@ class GooglepayModule implements ModuleInterface {
|
|||
$smart_button = $c->get( 'button.smart-button' );
|
||||
assert( $smart_button instanceof SmartButtonInterface );
|
||||
|
||||
/*
|
||||
* TODO: When PayLater is disabled and we're in "continuation" context, then no JS is enqueued.
|
||||
* Find a solution to enqueue the CheckoutBootstrap module in that situation.
|
||||
*/
|
||||
|
||||
if ( $smart_button->should_load_ppcp_script() ) {
|
||||
$button->enqueue();
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Checkout page, but no PPCP scripts were loaded. Most likely in continuation mode.
|
||||
* Need to enqueue some Google Pay scripts to populate the billing form with details
|
||||
* provided by Google Pay.
|
||||
*/
|
||||
if ( is_checkout() ) {
|
||||
$button->enqueue();
|
||||
}
|
||||
|
||||
if ( has_block( 'woocommerce/checkout' ) || has_block( 'woocommerce/cart' ) ) {
|
||||
/**
|
||||
* Should add this to the ButtonInterface.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue