Skip to content Skip to sidebar

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

Problem:
If you're experiencing a warning on the checkout page after a customer checks out with WPML and WooCommerce Multilingual & Multicurrency installed, and you also have the WooCommerce Memberships plugin activated, it might be due to a conflict. The specific warning message is: "Warning: foreach() argument must be of type array|object, string given in /home/.../wp-content/plugins/woocommerce-multilingual/compatibility/WcMemberships/class-wcml-wc-memberships.php on line 188".
Solution:
We recommend trying to disable either the WooCommerce Membership or the WooCommerce Multilingual & Multicurrency plugin temporarily to see if the warning disappears. This can help confirm if there is indeed a conflict between these plugins. If the issue persists, consider adjusting your site's script control policies as this has resolved the issue for another client.

Please note that this solution might be outdated or not applicable to your specific case. 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. If the problem continues, please open a new support ticket.

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

Last updated by wisenet 3 weeks, 5 days ago.

Assisted by: Dražen.

Author Posts
June 23, 2025 at 6:26 am #17158038

wisenet

Background of the issue:
I have WPML with WooCommerce Multilingual & Multicurrency installed, and I encountered a warning on the checkout page after a customer checked out. There may be a conflict with the WooCommerce Membership plugin. Here is the link to the WooCommerce Memberships plugin: https://woocommerce.com/products/woocommerce-memberships/. Below is the warning message that shows on my site: "Warning: foreach() argument must be of type array|object, string given in /home/petrolhead.hk/public_html/wp-content/plugins/woocommerce-multilingual/compatibility/WcMemberships/class-wcml-wc-memberships.php on line 188". Here is a screencap: hidden link. Here is the System Status report: hidden link.

Symptoms:
A warning message appears on the checkout page after a customer checks out: "Warning: foreach() argument must be of type array|object, string given in /home/petrolhead.hk/public_html/wp-content/plugins/woocommerce-multilingual/compatibility/WcMemberships/class-wcml-wc-memberships.php on line 188".

Questions:
What is causing the warning message on the checkout page?
Is there a conflict between WooCommerce Multilingual & Multicurrency and WooCommerce Membership plugin?

June 23, 2025 at 6:46 am #17158091

Dražen
Supporter

Languages: English (English )

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

Hello,

you have been inactive for a while.

Let me know how it goes and if issue still happens. It would helpful if you can also provide staging site so we can check the issue also.

Regadrs,
Drazen

June 23, 2025 at 7:12 am #17158206

wisenet

I have disabled all other plugins and the warning still showing

June 23, 2025 at 7:13 am #17158208

wisenet

AND after I set WP_MEMORY_LIMIT and WP_MEMORY_LIMIT in wp-config.php, there warning shows on both frontend and backend

Warning: Constant WP_MEMORY_LIMIT already defined in /home/petrolhead.hk/public_html/wp-config.php on line 89

Warning: Constant WP_MAX_MEMORY_LIMIT already defined in /home/petrolhead.hk/public_html/wp-config.php on line 90

June 23, 2025 at 7:27 am #17158246

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks.

Can you please share a staging site or Duplicator copy so we can check further?

- https://wpml.org/fr/faq/provide-supporters-copy-site/

Thanks,
Drazen

June 23, 2025 at 11:09 am #17159622

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks, I have tried with minimal environment as suggested, but I do not see any message image attached.

Can you please check if the issue still happens with this kind of environment, and if it does share steps with me. Maybe I am using different product.

Regards,
Drazen

Order received – Petrolhead Limited.jpg
June 28, 2025 at 3:54 am #17178909

wisenet

Hi,

After double checked the warning shows on checkout page after customer checkout success which conflict between WooCommerce Membership and WPML - WooCommerce Multilingual & Multicurrency

"Warning: foreach() argument must be of type array|object, string given in /home/petrolhead.hk/public_html/wp-content/plugins/woocommerce-multilingual/compatibility/WcMemberships/class-wcml-wc-memberships.php on line 188"

I have tried to disabled WooCommerce Membership or WooCommerce Multilingual & Multicurrency and the warning gone.

hidden link

Screen record:
hidden link

Please help to check, thanks

Best,
Chris

June 28, 2025 at 8:15 am #17179027

wisenet

Hi,

I have just fixed the issue since it is because my site has the script control. I adjust the policy and the problem fixed. I will mark the issue resolved. Many thanks

June 28, 2025 at 8:15 am #17179028

wisenet

Great support, thanks