Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 - -
- - - - - - -

Supporter timezone: Asia/Yerevan (GMT+04:00)

Tagged: 

This topic contains 3 replies, has 0 voices.

Last updated by Christopher Amirian 5 days, 10 hours ago.

Assisted by: Christopher Amirian.

Author Posts
August 2, 2025 at 5:28 pm #17290351

ondrejV-4

Background of the issue:
I am trying to implement a custom currency switcher template for a site under development. I followed all instructions from the documentation at https://wpml.org/documentation/related-projects/woocommerce-multilingual/designing-custom-currency-switchers-using-template-files/. I tested it in a custom theme and also in the Twenty Twenty-Five theme.

Symptoms:
The currency switcher is not appearing and is probably not registered by WPML. I have checked multiple times every step in the documentation, and the multicurrency setting should be okay.

Questions:
How I can make it working?

August 3, 2025 at 3:11 pm #17290997

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Welcome to WPML support. Would you please test by adding a normal currency switcher (not custom one) and see if the currency switcher works at all?

Also, the switcher usually works when there is a product. So please test it on a single product page.

Custom development is something that we do not give active technical support. We can not debug your code to see what might be the problem cause, but we will do our best to give you pointers.

Thanks.

August 3, 2025 at 4:15 pm #17291137

ondrejV-4

Hello,

of course I tried also classic currency switcher.

do_action('wcml_currency_switcher', array(
'format' => '%code%',
'switcher_style' => 'wcml-horizontal-list'
));

This echoes currency switcher, that works.

I understand, but you have in a documentation possibility to use custom templates. Rather than just modifying CSS of pre-defined switcher I would like to add some classes there.

Thank you

August 4, 2025 at 7:22 am #17291836

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

If you only want to add extra HTML classes (or a wrapper) and don’t need a fully custom template folder, you can keep WPML’s built-in switcher and wrap it (or pass classes via the switcher_style parameter). No template files are required.

/**
 * Place this where you want the switcher to appear
 * – e.g. in a template part or a shortcode callback.
 */
echo '<div class="currency-switcher my-extra-class">';
do_action(
	'wcml_currency_switcher',
	[
		'format'         => '%code%',          // shows only the code; change to %name%, etc.
		'switcher_style' => 'wcml-horizontal-list', // any of WPML's built-ins
	]
);
echo '</div>';

Everything inside the wrapper keeps WPML’s JS behaviour because the output still contains the mandatory wcml_currency_switcher class that WPML prints automatically. You’re free to target .my-extra-class (or any additional class you add) in your CSS.

Thanks.