Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client wants to add a currency code after the price in WooCommerce, such as USD or EUR, and modify the language selector to match the style of the currency selector.
Solution:
To display the currency code after the price, you can use the

woocommerce_price_format

filter. Here is an example of how you can customize it:

add_filter('woocommerce_price_format', 'custom_woocommerce_price_format', 10, 2);<br />function custom_woocommerce_price_format($format, $currency) {<br />    return '%1$s %2$s ' . $currency;  // Shows the currency code after the price<br />}

For more details, you can refer to these documentation links:

Since this customization is outside our support scope as it involves WooCommerce settings not directly related to WPML, we recommend consulting professional developers if further customization is needed. You can find qualified developers at https://wpml.org/contractors/.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket for further assistance.

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.

This topic contains 9 replies, has 2 voices.

Last updated by Bruno Kos 1 day, 12 hours ago.

Assisted by: Bruno Kos.

Author Posts
October 1, 2024 at 11:01 pm #16242985

keyunl

Background of the issue:
I want to add a currency code after the price, for example, USD or EUR. In the WooCommerce multi-currency settings, I didn't see any relevant options! Also, can you help me modify the language selector to match the style of the currency selector? That would make it more consistent!

Symptoms:
No specific issue or error message mentioned.

Questions:
How can I add a currency code after the price in WooCommerce?
Can you help me modify the language selector to match the style of the currency selector?

October 1, 2024 at 11:03 pm #16243023

keyunl

I added the language selector widget and language selector short code using Woodmart!

I'm not sure which one is more suitable for modification, you can freely modify one of the styles!

Any assistance would be greatly appreciated

exp.chnprints.com

October 2, 2024 at 11:48 am #16245289

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

Can you check these settings? Go to WooCommerce → WooCommerce Multilingual & Multicurrency and click the Multicurrency tab.

https://wpml.org/documentation/related-projects/woocommerce-multilingual/multi-currency-support-woocommerce/#configuring-currencies

Regards,
Bruno Kos

right with space.jpg
preview.jpg
October 2, 2024 at 11:53 am #16245331

keyunl

I'm not sure if you understand what I meant!
I was referring to adding the currency code after the price.

Since some currency symbols are the same, this will make it easier to distinguish!

I'll add a screenshot!

d6.png
October 2, 2024 at 12:47 pm #16245612

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

You can customize the WooCommerce price format to display currency codes like USD or EUR after the price using the `woocommerce_price_format` filter. Here's a quick example:

add_filter('woocommerce_price_format', 'custom_woocommerce_price_format', 10, 2);
function custom_woocommerce_price_format($format, $currency) {
    return '%1$s %2$s ' . $currency;  // Shows the currency code after the price
}

For further details, check out these references:
- hidden link
- hidden link

Since this is outside the support scope (there is no WPML setting for this, it all comes from WooCommerce), you may want to consult professional developers at https://wpml.org/contractors/.

October 2, 2024 at 1:39 pm #16245969

keyunl

ok, As I mentioned earlier, can you help me adjust the CSS of the selector?

October 2, 2024 at 6:32 pm #16247119

keyunl

hi, Just confirming, can it help with simple CSS adjustments?

October 3, 2024 at 5:02 am #16247853

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Please note that coding custom CSS falls outside the scope of our support. However, we can assist with minor adjustments.

Could you provide the URL where the switcher is located and clarify the specific styling changes you'd like to make?"

October 3, 2024 at 5:04 am #16247855

keyunl

exp.chnprints.com

Here!
Just hope it matches the currency selector and you're good to go!

thank you

October 3, 2024 at 5:51 am #16247893

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Not sure what you mean by "matches", but did you check settings here? You can style it directly by changing colors, etc.

https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#settings-per-language-switcher

styling.jpg
keyunl confirmed that the issue was resolved on 2024-10-03 09:12:27.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.