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