WPML
add_filter( 'wcml_custom_prices_strings', 'the_callback_function', 10, 2 );
Typ
filter
Version von WooCommerce Multilingual
3.8

Beschreibung

Ändern Sie die Strings, die im Abschnitt Preise in anderen Währungen manuell festlegen verwendet werden.

Argumente

An diesen Filter werden zwei Parameter übergeben:
$strings
(Array) Das String-Array, das im Bereich für benutzerdefinierte Preise verwendet wird. Es sieht wie folgt aus:
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) Die ID eines Originalprodukts.

Anwendungsbeispiel

Beispiel
/**
 * 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

Alle 24 Mehrwährungsfunktion-Hooks →