WPML
add_filter( 'wcml_custom_prices_strings', 'the_callback_function', 10, 2 );
유형
filter
카테고리
다중 통화 기능
WooCommerce Multilingual 버전
3.8

설명

다른 통화로 가격을 수동으로 설정 섹션에 사용된 문자열을 수정하세요.

인수

이 필터에는 두 개의 매개변수가 전달됩니다:
$strings
(array) 사용자 정의 가격 섹션에 사용되는 문자열 배열입니다. 다음과 같은 형태입니다:
array( 'not_set' => sprintf( __( 'Multi-currency is enabled but no secondary currencies have been set. %sAdd secondary currencies%s.', 'woocommerce-multilingual' ), '', '' ), 'calc_auto' => __( 'Calculate prices in other currencies automatically', 'woocommerce-multilingual' ), 'see_prices' => __( 'Click to see the prices in the other currencies as they are currently shown on the front end.', 'woocommerce-multilingual' ), 'show' => __( 'Show', 'woocommerce-multilingual' ), 'hide' => __( 'Hide', 'woocommerce-multilingual' ), 'set_manually' => __( 'Set prices in other currencies manually', 'woocommerce-multilingual' ), 'enter_prices' => __( 'Enter prices in other currencies', 'woocommerce-multilingual' ), 'hide_prices' => __( 'Hide prices in other currencies', 'woocommerce-multilingual' ), 'det_auto' => __( 'Determined automatically based on exchange rate', 'woocommerce-multilingual' ), '_regular_price' => __( 'Regular Price', 'woocommerce-multilingual' ), '_sale_price' => __( 'Sale Price', 'woocommerce-multilingual' ), 'schedule' => __( 'Schedule', 'woocommerce-multilingual' ), 'same_as_def' => __( 'Same as default currency', 'woocommerce-multilingual' ), 'set_dates' => __( 'Set dates', 'woocommerce-multilingual' ), 'collapse' => __( 'Collapse', 'woocommerce-multilingual' ), 'from' => __( 'From…', 'woocommerce-multilingual' ), 'to' => __( 'To…', 'woocommerce-multilingual' ), 'enter_price' => __( 'Please enter in a value less than the regular price', 'woocommerce-multilingual' ) )
$product_id
(integer) 원본 제품의 ID입니다.

사용 예시

예제
/**
 * Add this code to the functions.php file of your theme.
 */

add_filter( 'wcml_custom_prices_strings', 'set_labels_for_price_fields', 10, 2 );
function set_labels_for_price_fields( $strings, $product_id ){

    // Change the default text "Show" to "Display"
    $strings[ 'show' ] = __( 'Display', 'woocommerce-multilingual' ); 

    return $strings;

}

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_switch_currency, wcml_custom_prices_fields, wcml_multi_currency_ajax_actions

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