Send the locale if appropriate setting is selected

This commit is contained in:
Narek Zakarian 2022-12-19 19:49:16 +04:00
parent 19b189401d
commit d6b6ed3ed0
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
2 changed files with 2 additions and 2 deletions

View file

@ -982,7 +982,7 @@ class SmartButton implements SmartButtonInterface {
}
if ( $this->settings->has( 'smart_button_locale_override' ) && $this->settings->get( 'smart_button_locale_override' ) ) {
$params['lc'] = $this->locale;
$params['locale'] = $this->locale;
}
$smart_button_url = add_query_arg( $params, 'https://www.paypal.com/sdk/js' );

View file

@ -1395,7 +1395,7 @@ return array(
$locale = get_user_locale();
$wp_paypal_locale_map = $container->get( 'wcgateway.wp-paypal-locales-map' );
$locale = $wp_paypal_locale_map[ $locale ] ?: $locale;
$locale = $wp_paypal_locale_map[ $locale ] ?? $locale;
return apply_filters( 'woocommerce_paypal_payments_button_locale_override', $locale );
},