Skip Navigation
availability:

WooCommerce Multilingual Version: 3.8

description:

Modify strings used in the Set prices in other currencies manually section.

type:
filter
category:
Multi-currency Feature
parameters:
add_filter( 'wcml_custom_prices_strings', 'the_callback_function', 10, 2 );

There are two parameters passed to this filter:

$strings
(array) The string array used in the custom price section. It looks like the following:
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) The ID of an original product.
hook example usage:

Example

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

}