wcml_geolocation_get_user_country
- 유형
- filter
- 카테고리
- 다중 통화 기능
- WooCommerce Multilingual 버전
- 4.11.0
설명
WCML 위치 기반 국가의 재정의를 허용합니다.
인수
- $userCountry
- (문자열) 설정된 경우 청구지 주소가 사용되며, 그렇지 않으면 지리적 위치 기반 국가가 사용됩니다.
- $allUserCountries
- (배열) {
- @key $billing
- (문자열) 청구지 주소 국가
- @key $shipping
- (문자열) 배송지 주소 국가
- @key $geolocation (문자열) 지리적 위치 기반 국가
사용 예시
// 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 );
관련 훅
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