Use currency conversion function manually

Highlighted
New Member
2 0 0

Hi there,


I have a multilingual shop with LangShop. I also have 3 different currencies in the shop, with EUR being my main currency.

The currency conversion takes place automatically in the shopping cart, checkout and on the product pages using a Shopify function based on the current exchange rate.

However, since I have also entered product prices manually at various points on the website, I would like to be able to trigger this function manually. Can someone help me with this, where I can find documentation on this function and how I can include it in the theme?

I have the same problem with the shipping costs, which I also specified in different places. I would also like to have these converted.

 

Thanks and best regards, 

Timo

0 Likes
Excursionist
13 0 9

Hey Timo,

 

If you have some custom money values in your theme templates and want to make them convertible via Langshop currency converter, you can do this by including a snippet.

 

For example, you have a price '$22' somewhere in the code. To make it convertible, you can replace it with the following code:

{%- render "ls-price", price: 2200, filter: "money" -%}

After this, the value will be recognized as a price and will be converted when the currency is changed.

 

Note that this code works only if you have the latest version of the Langshop app installed (v.2+). For the earlier versions, the code should be different. Ping me or write to support@langshop app if you need further guidance on this.

 

1 Like
Highlighted
New Member
2 0 0

Hi Taras1,

 

thanks a lot. Is is also possible to use this inside the language.json file? 

 

Best Regards,

Timo

0 Likes
Highlighted
Excursionist
13 0 9

Hi Timo,

 

There's no such code for .json file. Maybe it is possible to work with the variable on the .liquid level. Please send an email to support@langshop.app with more detailed information about your particular case. I'm sure there will be a solution.

 

Regards,

Taras.

0 Likes