Skip Navigation

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

Problem:
The client is experiencing issues with checking orders in the WooCommerce app, which was identified to be caused by the WPML String Translation plugin.

Solution:
We recommend the following workaround to address the issue with PHP 8.1.X:
1. Edit the file

wp-content/plugins/woocommerce-multilingual/classes/Rest/Wrapper/Orders/Languages.php

2. On line 45, replace the code:

if ( $orderLanguage !== $language ) {

with:

if ( $orderLanguage !== $language && !empty($language)) {

The issue arises because the app does not set the

$language

parameter, leading to a notice when WPML tries to match the order language with the current language, which is not set in the app.

If this solution does not apply to your situation, or if it seems outdated, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please do not hesitate to open a new support ticket in the WPML support forum.

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 14 replies, has 2 voices.

Last updated by Osama Mersal 1 year, 4 months ago.

Assisted by: Osama Mersal.

Author Posts
March 2, 2024 at 2:00 pm #15365750

chun-pongt

I am trying to: check order in woo-commerence app, and i try to disble plugin one by one , and found it is cause by WPML String Translation, do anyone have idea why it is happen and how to solve it ?

error.jpg
March 3, 2024 at 7:03 am #15366340

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

Please let me know if this issue happens on the desktop. If yes, Please share screenshots or a screen-recorded video while reproducing the issue.

Best regards,
Osama

March 4, 2024 at 10:30 am #15368776

chun-pongt

Hi Osama,

Actaully it is both working in desktop and mobile web in dashboard,
It is just not working woo-commernce app which download in google app store and ios apple store,

i asked woo-commernce support , their reply is Since you've identified that the WPML plugin isn't compatible with the WooCommerce app, so unfortunately, we can't offer support for it.

So i ask if wpml know what problem is it , as wpml string translation should be lot of woo-commerence user use it , should have someone face it before

Let me know if need more inofmration

Best regards
Mango

March 4, 2024 at 11:13 am #15369005

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi Mango,

If the issue doesn't happen on the web version, I'm afraid that we can be very helpful in this case as the mobile App is not compatible with WPML, as WooCommerce support stated.

Sorry for the inconvenience

Best regards,
Osama

March 4, 2024 at 2:16 pm #15370062

chun-pongt

So my i ask is it still a comman issue it cant connect woo-commerence app with wpml ? as i saw some topic in 2021 in here

March 4, 2024 at 3:01 pm #15370291

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

I didn't see a similar issue for a while and the last one was not related to String Translation.

Best regards,
Osama

March 5, 2024 at 10:01 am #15373535

chun-pongt

Dear Support,

I try to create a new site with wpml to test, i found that once there set a second language in setup, even havent translate anything, the woo-commerence app cant check the order. if dsiable WPML Multilingual CMS or WPML String Translation plugin, it is worfking fine

Sound really a compatible problem , and it is not happen my other project using polylang

March 5, 2024 at 10:15 am #15373574

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for your update. WPML is compatible with WooCommerce sites, not Apps. Kindly check this guide. (https://wpml.org/documentation/related-projects/woocommerce-multilingual/)

I'll check with our compatibility team to see if we can help in this case.

Best regards,
Osama

March 5, 2024 at 11:53 am #15374282

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Could you please let me know how this app is created and how it retrieves the data from the site?

Best regards,
Osama

March 5, 2024 at 3:18 pm #15375247

chun-pongt

Hi,
The app is official launch by woocommerce
hidden link
hidden link

Just asked the woo-commerence support , they just give the rest api doc hidden link

hope it can help
Mango

March 5, 2024 at 3:35 pm #15375334

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi Mango,

I've consulted our 2nd tier support team regarding this issue, and I'll update you as soon as I get their reply.

Best regards,
Osama

March 5, 2024 at 3:56 pm #15375403

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP)
Preferably to a test site where the problem has been replicated.

Your answer will be private, meaning only you and I can access it.

❌ Please backup your database and website ❌

✙ I would need your permission to de-activate and re-activate the Plugins and the Theme and change configurations on the site. This is also a reason the backup is critical.

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

✙ Please share the app download URL to check the issue.

Best regards,
Osama

March 6, 2024 at 4:04 pm #15380685

chun-pongt

Dear Support,

Thank for your demo site , that made me solve the problem finally , i copy your demo site to my side and still have a problem, and i check the logs, there have an php warming
[06-Mar-2024 14:49:38 UTC] PHP Warning: Undefined array key "line_items" in /home/shusquare/www/bestore/wp-content/plugins/woocommerce-multilingual/classes/Rest/Wrapper/Orders/Languages.php on line 46
[06-Mar-2024 14:49:38 UTC] PHP Warning: foreach() argument must be of type array|object, null given in /home/shusquare/www/bestore/wp-content/plugins/woocommerce-multilingual/classes/Rest/Wrapper/Orders/Languages.php on line 46

and i try to use php version 7.4 (before i use 8.1), and then it is working, may be some function on your site in line 46 is not a support funtion in php 8. May be your can pass this info for the developer for update the script if need

Thank again for help on this journal

Mango

have a good day

March 6, 2024 at 4:05 pm #15380686

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi Mango,

It's great to hear that the issue is fixed 🙂 . Please don't hesitate to open a new ticket if you face any other issues. We are always happy to help you.

Have a great day!

Best regards,
Osama

March 7, 2024 at 3:09 pm #15385191

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi Mango,

Our 2nd tier support team has found a workaround to work with PHP 8.1.X. Please check the following steps:

1- Edit the (wp-content/plugins/woocommerce-multilingual/classes/Rest/Wrapper/Orders/Languages.php) file
2- Replace the following line: Line 45

if ( $orderLanguage !== $language ) {

With

if ( $orderLanguage !== $language && !empty($language)) {

The problem, as far as we can see, is that the app does not set the parameter:

$language      = get_query_var( 'lang' )

WPML tries our logic and produces a notice because the order language does not match the current language. In the app, there is no way to set a language.

I hope this helps you fix the issue. Please let me know if you need further assistance.

Best regards,
Osama