Skip Navigation

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

Problem:
The client identified a bug in WooCommerce Multilingual when dealing with product bundles. The issue arises from a deprecated method of accessing product properties directly, which generates a PHP notice. Specifically, the bug was found in

wp-content/plugins/woocommerce-multilingual/compatibility/WcProductBundles/class-wcml-product-bundles.php

on line 796.

Solution:
We acknowledged the bug reported by the client and confirmed it with our team. The client provided a temporary fix by replacing

$cart_item['data']->product_type === 'bundle'

with

$cart_item['data']->get_type() === 'bundle'

. We have escalated the issue for a permanent fix in a future update of WooCommerce Multilingual.

If you're experiencing this issue, we recommend applying the temporary fix provided by the client. However, please note that this solution might be outdated or not applicable to your case. If the problem persists, we highly recommend checking 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.

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

Last updated by Mihai Apetrei 1 year ago.

Assisted by: Mihai Apetrei.

Author Posts
April 18, 2024 at 1:33 pm #15539158

gerritG-2

Found Bug:

at wp-content/plugins/woocommerce-multilingual/compatibility/WcProductBundles/class-wcml-product-bundles.php line 796

//BUG if ( isset( $cart_item['bundled_items'] ) && $cart_item['data']->product_type === 'bundle' ) {
// The line below corrects it
if ( isset( $cart_item['bundled_items'] ) && $cart_item['data']->get_type() === 'bundle' ) {

Why? This pops up if the cart has items with product bundles.

[17-Apr-2024 16:24:04 UTC] PHP Notice: Function product_type was called incorrectly. Product properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Cart_Session->get_cart_from_session, apply_filters('woocommerce_get_cart_item_from_session'), WP_Hook->apply_filters, WCML_Product_Bundles->resync_bundle, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong Please see <a>Debugging in WordPress for more information. (This message was added in version 3.0.) in /htdocs/cfg.idworx-bikes.de/wp-includes/functions.php on line 6078

Putting the shown fix removed the bug.

Everything is at the newest version.

Thanks so much for updating this as shown above.

Dennis.

April 18, 2024 at 11:17 pm #15541369

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi and thank you, Dennis.

I will share this with our team.

Mihai

April 20, 2024 at 9:37 pm #15546493

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi Dennis.

I'm back to let you know that the bug has been confirmed by my colleagues and has been further escalated for a future fix.

Once again: thank you for reporting this and for sharing the solution that you found.

Mihai

April 21, 2024 at 4:16 pm #15547536

gerritG-2

You're welcome. We've found another more critical bug within WooCommerce translations and will file another ticket. It might be related. Greetings, D G

April 21, 2024 at 9:33 pm #15547755

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Perfect, thank you!

I reported that one already, too.

Can you please mark this ticket as resolved as the issue has been already confirmed and escalated further?

Thank you!

Mihai

April 22, 2024 at 10:17 am #15549533

gerritG-2

Thanks so kindly.
D G