Product Addons = Undefined index + Invalid argument supplied for foreach()
-
Hello after so expected update to Woo Multi 4.4.0, with PA 3.0.8 Im getting two errors:
Notice: Undefined index: options in /hosting/www/exapmle.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556
Is there any date when WPML and Woo PA 3+ compatibility will be fixed finally?
Thanks you
-
Hello!
You are the first that report a case like this one.
From what I see, there might be something wrong in your database.
Did you try to re-save the product with its product addon in question?Are you using the latest WPML plugins and their addons too?
Have you checked if you can test with a newly created similar product – if there is the same problem?
Hello George,
– Yes, Ive tried re-save the product with its product addon.
– Ive tried re-save the product global product addons too.
– Yes, Im using latest WPML plugins.During last test (to add new product) and during re-saving global addons I realised, that errors are caused by error that is not still fixed (see below)… it is caused by global addons (not product level addons and with Product Addons 3+).
It looks like it is known error: WPML forumIve contacted Woocommerce sometime ago and thay said that is problem on WPML side.
Problem is that incompactibility is forcing us to stay with WordPress 4+ and old Woocommerce etc…
If it helps… here is whole error log that show up at back-end during re-saving an global addon:
Notice: Undefined index: product_addon_option_label in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-product-addons/includes/admin/class-wc-product-addons-admin.php on line 401 Notice: Undefined index: product_addon_option_price in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-product-addons/includes/admin/class-wc-product-addons-admin.php on line 402 Notice: Undefined index: product_addon_option_price_type in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-product-addons/includes/admin/class-wc-product-addons-admin.php on line 403 Notice: Undefined index: product_addon_option_image in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-product-addons/includes/admin/class-wc-product-addons-admin.php on line 404 Notice: Undefined index: options in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Notice: Undefined index: options in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Notice: Undefined index: options in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Notice: Undefined index: options in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Notice: Undefined index: options in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Notice: Undefined index: options in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 556 Notice: Undefined index: options in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 121 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 121 Notice: Undefined index: options in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 121 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 121 Notice: Undefined index: options in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 121 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 121 Notice: Undefined index: options in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 121 Warning: Invalid argument supplied for foreach() in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 121 Notice: Undefined index: product_addon_option_label in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-product-addons/includes/admin/class-wc-product-addons-admin.php on line 401 Notice: Undefined index: product_addon_option_price in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-product-addons/includes/admin/class-wc-product-addons-admin.php on line 402 Notice: Undefined index: product_addon_option_price_type in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-product-addons/includes/admin/class-wc-product-addons-admin.php on line 403 Notice: Undefined index: product_addon_option_image in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-product-addons/includes/admin/class-wc-product-addons-admin.php on line 404
Thank you for reporting this.
I have escalated it to our developers to take a lookThanks you too .-)
Hello George,
I just updated to new Woo Multi to 4.4.1 and I wanted to let you know:
After that update it is now possible to make new global addon, save it and resave, translate it without any error.
Old global addons are still producing same errors (I posted above).Unfortunately after update some of product level addons started produce this new error:
Notice: Undefined index: price in /hosting/www/example.cz/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 179
This error disappear after product addon (and product) is updated… but because of product quantity to update every product would be time-consuming… do you think it is necessary update every product or there will be fix for this error?
Thanks you
TomThank you for reporting this case @gorem
Our developers will fix this too.
Please go to /wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php and replaceif ( $addon['price'] ) {
with
if ( isset( $addon['price'] ) && $addon['price'] ) {
This should fix the problem.
Thanks you .-)
Hello George,
after some time, Ive noticed (on our developer version of web, that Im not visiting regularly) that there is other similar notice + warning on other line:Mar 18, 17:33:53 Notice: Undefined index: options in /hosting/www/example.com/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 191 Mar 18, 17:33:53 Warning: Invalid argument supplied for foreach() in /hosting/www/example.com/www.dev/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-product-addons.php on line 191
Strange is that it seems to be not connected to visiting any product, but it seems that it happened after log-in or during Wp-Rocket is preloading cache.
Thanks you
Since we don’t have news for some time, I am closing this ticket.
If you still have problem, please feel free to open a ticket in wpml.org so we can help you.
Thank you very much
- The topic ‘Product Addons = Undefined index + Invalid argument supplied for foreach()’ is closed to new replies.