Remove all unnecessary registerCheckoutBlock code in favor of the correct simplified solution

This commit is contained in:
Daniel Dudzic 2024-04-17 02:06:41 +02:00
parent ad2c8e9aed
commit 43869993c6
No known key found for this signature in database
GPG key ID: 31B40D33E3465483
19 changed files with 157 additions and 440 deletions

View file

@ -428,8 +428,6 @@ class SmartButton implements SmartButtonInterface {
)
);
die(var_dump($has_paylater_block));
$get_hook = function ( string $location ) use ( $default_pay_order_hook, $is_block_theme, $has_paylater_block ): ?array {
switch ( $location ) {
case 'checkout':
@ -646,11 +644,11 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
$messaging_enabled_for_current_location = $this->settings_status->is_pay_later_messaging_enabled_for_location( $location );
$has_paylater_block =
PayLaterBlockModule::is_block_enabled( $this->settings_status ) &&
has_block( 'woocommerce-paypal-payments/paylater-messages' ) ||
has_block( 'woocommerce-paypal-payments/checkout-paylater-messages' ) ||
has_block( 'woocommerce-paypal-payments/cart-paylater-messages' );
$has_paylater_block = PayLaterBlockModule::is_block_enabled( $this->settings_status ) && has_block( 'woocommerce-paypal-payments/paylater-messages' );
if ( 'cart-block' === $location || 'checkout-block' === $location ) {
return true;
}
switch ( $location ) {
case 'checkout':