WPML
apply_filters( 'wcml_product_price_by_currency', integer $product_id, string $currency )
유형
filter
카테고리
다중 통화 기능
WooCommerce Multilingual 버전
3.9

설명

  • 이 훅은 입력된 경우 사용자 정의 가격을 반환합니다. 그렇지 않으면 설정된 환율에 따른 가격을 반환합니다.
  • 이 훅은 프런트엔드에서만 작동합니다.

인수

$product_id
(정수) (필수) 상품 ID
$currency
(문자열) (필수) 가격을 가져올 통화 코드(예: “USD”, “EUR” 등)

사용 예시

예제
 // Get the EUR price of the product ID = 80 
$product_id = 80; 
$currency = 'EUR'; 
echo apply_filters( 'wcml_product_price_by_currency', $product_id, $currency );
 
참고: 다중 통화 코드가 항상 로드되는 것은 아닙니다. 이 필터가 작동하지 않는 경우 wcml_load_multi_currency_in_ajax 훅을 확인하세요.

wcml_custom_prices_fields_labels, wcml_is_cache_enabled_for_switching_currency, wcml_geolocation_get_user_country, 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

모든 다중 통화 기능 훅 24개 →