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.

Our next available supporter will start replying to tickets in about 0.28 hours from now. Thank you for your understanding.

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: America/Lima (GMT-05:00)

This topic contains 5 replies, has 3 voices.

Last updated by Andreas W. 7 months ago.

Assisted by: Andreas W..

Author Posts
April 9, 2024 at 9:17 am #15497791

donatasS

Hello, how i can change product tax rate by changing shop language, for example:

hidden link

For example LTU tax = 21%, DE = 9% And it should automaticaly change price. How can i do that ?

April 9, 2024 at 10:58 am #15498568

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML support. While you are waiting for one of my colleagues to take this ticket and work on it, let me provide you with the first reply.

I am afraid that is not possible since tax is not related to language but to the location of the customer. You can use regular WooCommerce settings and set tax value per country, which is then changed depending on the customer's address. WPML does not have any effect on this.

You can assign different tax rates for each country under WooCommerce > Settings > Tax > Standard rates.

Hope this makes sense.

Regards,
Drazen

April 9, 2024 at 2:55 pm #15500027

donatasS

Maybe by writing some custom code and checking what languge is.. using ICL_LANGUAGE_CODE statement ?

April 9, 2024 at 6:09 pm #15500813

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

The WooCommerce Options do control the tax in this case:

https://woocommerce.com/document/setting-up-taxes-in-woocommerce/

If you set up a tax for Germany in WooCommerce it is what is applied to the client, based on the client´s billing/shipping address or the shop's location.

You would need to hook into WooCommerce to change this behavior.

hidden link

WPML does not have any influence on this directly.

---

About your question:

Surely you can use ICL_LANGUAGE_CODE to setup language conditions per language code, like :

if (ICL_LANGUAGE_CODE == 'en'){
  //your code
}

It might be even better to use the following hook:

https://wpml.org/faq/how-to-get-current-language-with-wpml/

More WPML and WCML Hooks:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

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

Usually, custom code should not be necessary in this case - not sure what kind of approach you are taking and what you are expecting.

April 15, 2024 at 8:09 am #15517582

donatasS

Well the main goal is whatever custom code bet the result i need. I thought then i need to somehow handly calculate each country tax rate and round using WML statements

April 16, 2024 at 4:57 pm #15527359

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Taxes and rounding prices are in this case a WooCommerce topic. WPML will use the price that is declared inside WooCommerce and convert it into other currencies.

Rounding WooCommerce prices is handled here:
https://stackoverflow.com/questions/61836970/how-can-i-round-up-the-price-in-woocommerce

Take note, that I did not test those suggestions.

More WooCommerce related hooks can be found here:
hidden link

If your goal is to apply rules to rounded prices, then you can use this hook:
https://wpml.org/wcml-hook/wcml_rounded_price/

The topic ‘[Closed] Woocomerce change product tax rate by changing shop language’ is closed to new replies.