wcml_geolocation_get_user_country
- Tipo
- filter
- Categoria
- Funzionalità multivaluta
- Versione di WooCommerce Multilingual
- 4.11.0
Descrizione
Consenti la sovrascrittura del paese geolocalizzato di WCML.
Argomenti
- $userCountry
- (stringa) Indirizzo di fatturazione utilizzato se impostato, altrimenti il paese di geolocalizzazione.
- $allUserCountries
- (array) {
- @key $billing
- (stringa) Il paese dell’indirizzo di fatturazione
- @key $shipping
- (stringa) Il paese dell’indirizzo di spedizione
- @key $geolocation (stringa) Il paese di geolocalizzazione
Esempio di utilizzo
// Always use the shipping address if it's available
add_filter( 'wcml_geolocation_get_user_country', function( $userCountry, $allCountries ) {
return ! empty( $allCountries['shipping'] ) ? $allCountries['shipping'] : $userCountry;
}, 10, 2 );
Hook correlati
wcml_custom_prices_fields_labels, wcml_is_cache_enabled_for_switching_currency, wcml_user_store_strategy, wcml_rounded_price, wcml_currencies_without_cents, wcml_product_custom_prices, wcml_custom_prices_strings, wcml_switch_currency, wcml_custom_prices_fields, wcml_multi_currency_ajax_actions