🚧 Enqueue missing script for billing data logic

When PayLater is disabled and we're in "continuation" context, then the new billing data logic is not working: The relevant JS script is not enqueued.
This commit is contained in:
Philipp Stracker 2024-08-26 18:22:42 +02:00
parent 010f5fbdf1
commit 3e0a44ca1f
No known key found for this signature in database

View file

@ -93,6 +93,12 @@ class GooglepayModule implements ModuleInterface {
static function () use ( $c, $button ) {
$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;