Home›Support›English Support›[Resolved] Warning shows with woocommerce-multilingual and WooCommerce Membership on after checkout
[Resolved] Warning shows with woocommerce-multilingual and WooCommerce Membership on after checkout
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.
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?
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.
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