Simplify message wrapper rendering and add shop, home locations

This commit is contained in:
Alex P 2023-10-16 21:41:17 +03:00
parent 0062f20c7a
commit 7da5d8d68a
No known key found for this signature in database
GPG key ID: 54487A734A204D71
6 changed files with 328 additions and 45 deletions

View file

@ -1354,7 +1354,13 @@ return array(
'wcgateway.settings.pay-later.messaging-locations' => static function( ContainerInterface $container ): array {
$button_locations = $container->get( 'wcgateway.button.locations' );
unset( $button_locations['mini-cart'] );
return $button_locations;
return array_merge(
$button_locations,
array(
'shop' => __( 'Shop', 'woocommerce-paypal-payments' ),
'home' => __( 'Home', 'woocommerce-paypal-payments' ),
)
);
},
'wcgateway.button.default-locations' => static function( ContainerInterface $container ): array {
return array_keys( $container->get( 'wcgateway.settings.pay-later.messaging-locations' ) );