mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Remove all unnecessary registerCheckoutBlock code in favor of the correct simplified solution
This commit is contained in:
parent
ad2c8e9aed
commit
43869993c6
19 changed files with 157 additions and 440 deletions
|
@ -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':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue