Skip Navigation

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

Problem:
If you're trying to change the language on a WooCommerce order-pay page and encountering issues where the URL does not translate correctly, leading to the incorrect template being loaded. Specifically, the '?pay_for_order=true' parameter is missing in the translated URL, which causes WooCommerce to change the template.
Solution:
We recommend using WPML's feature to preserve URL arguments. You can find this setting under WPML -> Languages -> Language switcher options. Enabling this option will ensure that the 'pay_for_order' argument is preserved when switching languages on an order page. For more details, please check the documentation on preserving URL arguments here.

If this solution does not resolve your issue or seems outdated, 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 further assistance is needed, please open a new support ticket here.

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 0 reply, has 0 voices.

Last updated by marcoR-2 1 month, 2 weeks ago.

Assisted by: Itamar.

Author Posts
April 17, 2025 at 9:31 am #16943006

marcoR-2

Background of the issue:
Estoy intentando cambiar el idioma en una página de pedido en WooCommerce. Estoy en una página de pedido con este slug: /en/process-order/order-pay/16537/?pay_for_order=true&key=wc_order_V6GvbP9G13UET. Al hacer clic en español, la URL cambia a /procesar-pedido/pagar-pedido/16537/?key=wc_order_V6GvbP9G13UET. El problema es que si no está presente ?pay_for_order=true, WooCommerce cambia la plantilla y no muestra la correcta. Aquí está el enlace a la página donde se puede ver el problema: hidden link.

Symptoms:
La URL no se traduce correctamente al cambiar de idioma, lo que resulta en la carga de una plantilla incorrecta.

Questions:
¿Por qué WooCommerce cambia la plantilla cuando falta ?pay_for_order=true?
¿Cómo puedo asegurarme de que la URL se traduzca correctamente al cambiar de idioma?

April 17, 2025 at 7:38 pm #16945698

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I've checked things on a fresh WordPress installation. WPML has a feature to preserve URL arguments. You can use this feature to preserve the pay_for_order argument. The setting is in WPML -> Languages -> Language switcher options. Please see the attached screenshot. Enabling this option will preserve the pay_for_order argument when switching languages on an order page. I tried it on my test, and you can see it here.

hidden link

Please let me know if you have any further questions.

Regards,
Itamar.

2025-04-17_22-18-12.jpg
April 21, 2025 at 6:48 pm #16952645

marcoR-2

That worked.

Thank you.