Add eligibility notice.

This commit is contained in:
Pedro Silva 2023-09-21 18:30:43 +01:00
parent ad018766a6
commit dc77deea79
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
4 changed files with 102 additions and 9 deletions

View file

@ -24,6 +24,8 @@ return array(
return $fields;
}
$is_available = $container->get( 'googlepay.available' );
$insert_after = function( array $array, string $key, array $new ): array {
$keys = array_keys( $array );
$index = array_search( $key, $keys, true );
@ -66,6 +68,15 @@ return array(
->action_visible( 'googlepay_button_language' )
->action_visible( 'googlepay_button_shipping_enabled' )
->to_array(),
$display_manager
->rule()
->condition_is_true( $is_available )
->action_enable( 'googlepay_button_enabled' )
->action_enable( 'googlepay_button_type' )
->action_enable( 'googlepay_button_color' )
->action_enable( 'googlepay_button_language' )
->action_enable( 'googlepay_button_shipping_enabled' )
->to_array(),
)
),
),