Skip Navigation

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.

Tagged: 

This topic contains 19 replies, has 2 voices.

Last updated by mattiasL-9 1 year, 10 months ago.

Assisted by: Andreas.

Author Posts
March 20, 2023 at 2:28 pm #13285339

mattiasL-9

I am trying to:
Ferrita.com want to have only one currency showing on the site. But when switching between swedish and english, the currency "value" from let say 599kr dont change to 599 SEK.

I have checked the settings and tried different settings, but it wont change.
What am i doing wrong?

currency.PNG
March 20, 2023 at 2:57 pm #13285551

Andreas

Hello there

Thank you for contacting us. I am happy to help you.

From your image, I can understand that you have set only one currency.

In your description, you are mentioning 2 currencies. You need to add 2 currencies, and configured them and then you will have the desired result

If something else is happening, please give me more details in order to understand better and help you.

Just in case I am sharing also the documentation for WCML

https://wpml.org/documentation/related-projects/woocommerce-multilingual/

Regards,
Andreas

March 20, 2023 at 3:01 pm #13285563

mattiasL-9

No i only want one currency, the swedish currency is displayed in kr in sweden, and SEK in the world.
I wonder how i can display SEK instead of kr when switching to english?

March 20, 2023 at 3:29 pm #13285891

Andreas

Thank you for the clarification.

I prepared a small screencast. Mau I ask you to take a look and tell me if I am doing something wrong because, from my point of view, it seems correct.

hidden link

Regards,
Andreas

March 20, 2023 at 3:49 pm #13286131

mattiasL-9

Thanks for the recording.
But im sorry that i forgot to tell you that the current ferrita.com is not a wordpress site. We have rebuilt ferrita.com on another web hosting, so im working on the new ferrita.com with a local redirect.

But to see my issue, go to this page. It has the same settings of my first screen shot: hidden link
try to switch language and you will see that it is not going to change from kr to SEK.

What do i need to do to get it to change for the swedish currency?

March 20, 2023 at 4:01 pm #13286263

Andreas

Thank you for the information.

I think I get confused a little bit now.

I have check the above URL and I can see on kr currency for both language, which is the same as the image you shared.

May I ask you to explain to me one more time with details what you are expecting to see per language?

Regards,
Andreas

March 20, 2023 at 4:29 pm #13286561

mattiasL-9

Im sorry for the confusion i may have ocurred.

So lets look on a product to make this clear (i hope): hidden link

In the swedish language, the price is shown as 16995kr.

When you switch to english, it still says 1699kr.
I want the english price to be shown like 1699 SEK.

Let me know if this explains my issue, or if i need to ellaborate 🙂

March 21, 2023 at 11:13 am #13292747

Andreas

Thank you very much for your explanation.

So you wish to have different currencies per language

In Swedish language the currency should be KR

In the English language should be SEK.

Is this correct can you please confirm?

Also, the prices per language will be converted based on a rate that you will add in the primary currency and will be automatically converted to secondary or do you wish to have totally different prices per currency?

Regards,
Andreas

March 24, 2023 at 6:10 am #13320163

mattiasL-9

That is correct that i want kr for the swedish language and SEK for the english language.

However, the currency is the same on both languages: Swedish kronor
But the price indication is different for the two languages.

Example:
599kr for swedish language.
599 SEK for english language.

Same currency, different price indication.

March 24, 2023 at 9:35 am #13321785

Andreas

Would you be willing to provide me with WordPress credentials so I could investigate the issue directly?

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

I marked your next reply as private so that you can safely add credentials.

March 24, 2023 at 1:11 pm #13323501

Andreas

Thank you very much.

Looking in your site and better your request I think I am having a question that I cannot understand.

SEK and kr is the same currency.

hidden link

May I ask you what exactly you wish to do with Multi-Currency of WCML ?

Looking forward for your reply.

Regards,
Andreas

March 25, 2023 at 6:39 am #13328201

mattiasL-9

They wanted multicurrency at the beginning. but the longer the project went they only wanted to show the swedish currency but in different price indication (kr in swedish language and SEK for english language).

But there may be an easier way to display kr for swedish language and SEK for english language rather than set it in multicurrency tab?

March 27, 2023 at 11:00 am #13337753

Andreas

Thank you very much for your reply.

I am afraid that this cannot be done our of the box and it needs a custom code because you need different currency symbols and different prices for actually the same currency code.

It is out of the scope of this forum to provide support for custom code, but I will give you some hints in order to test it and try to achieve it.

I can think of something like this :

Add a secondary currency and fix the currency rate for example. The in frontend change the currency symbol with the correct symbol.

Have in mind that this is a very basic example, I have no tested it or maybe you wish to add more code to include more places.

function change_currency_symbol_based_on_language( $currency_symbol, $currency ) {
    // Get the current language
    $current_language = apply_filters( 'wpml_current_language', NULL );

    // Define currency symbol based on the language
    switch ( $current_language ) {
        case 'en':
            if ( $currency == 'SEK' ) {
                $currency_symbol = 'SEK';
         case 'sv':
            if ( $currency == 'you_other_currency' ) {
                $currency_symbol = 'kr';
            }
         default:
            if ( $currency == 'SEK' ) {
                $currency_symbol = 'SEK';
            }
            break;
    }

    return $currency_symbol;
}
add_filter( 'woocommerce_currency_symbol', 'change_currency_symbol_based_on_language', 10, 2 );

Or maybe you can register a custom currency and see if WCML can read it correctly and then and make the proper changes there.

Please read all hooks of WCML

https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/

And the snipper for custom code :

https://woocommerce.com/document/add-a-custom-currency-symbol/

Also you can read a similar topic here:

https://wpml.org/forums/topic/same-currency-different-formatting-for-different-languages-woocommerce/

Again the above are just some hints and not the final solutions.

I hope this helps. Please let us know how it goes or if you need any further assistance. I'll gladly help you. 🙂

Regards,
Andreas

March 27, 2023 at 2:01 pm #13339557

mattiasL-9

Ok that some bad news :/ But i really appreciate that you getting some examples to test.

I even tried to just search for the string "kr" in hope that the string was going to be found and i was able to translate it to SEK.

March 27, 2023 at 2:08 pm #13339595

Andreas

Thank you for your kind words.

But even if you translate the string, you need to have different prices per language.

If you don't need it and you just need to show something different per language, you need to ensure that it will show properly in all places including emails etc.

If everything is working as expected, then it would be great.

Regards,
Andreas