Overview of the Issue
If you are using WooCommerce Product Bundles plugin, you will notice that a PHP notice occurs when a bundle product is added to the cart:
PHP Notice: Function product_type was called incorrectly. Product properties should not be accessed directly...
Workaround
This issue is fixed in WooCommerce Multilingual & Multicurrency 5.4.0. Updating solves it on your site, so you only need this workaround if you can’t update yet.
Please, make sure of having a full site backup of your site before proceeding.
- Open …/wp-content/woocommerce-multilingual/compatibility/WcProductBundles/class-wcml-product-bundles.php file
- Look for line 796.
- Replace:
PHP
if ( isset( $cart_item['bundled_items'] ) && $cart_item['data']->product_type === 'bundle' ) {
- With:
PHP
if ( isset( $cart_item['bundled_items'] ) && $cart_item['data']->get_type() === 'bundle' ) {