Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 -

Supporter timezone: Europe/Zagreb (GMT+02:00)

This topic contains 0 reply, has 0 voices.

Last updated by Dražen 1 month, 2 weeks ago.

Assisted by: Dražen.

Author Posts
April 15, 2025 at 8:30 am #16932380

desireeM

Background of the issue:
You fixed part of this issue already in 5.4.0 https://wpml.org/errata/woocommerce-product-bundles-php-notice-function-product_type-was-called-incorrectly/
However you forgot to also update/fix it just a few lines below your change for $cart_item['data']->bundle_data
which still reports "bundle_data was called incorrectly"

WCML 5.4.2

Symptoms:
I expected to see no deprecated warning, but instead, I got the error message: 'bundle_data was called incorrectly'.

Questions:
Fix it

April 15, 2025 at 8:49 am #16932513

Dražen
Supporter

Languages: English (English )

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

Hello,

I have tried to reproduce the issue, to escalate it further, but it seems I can not get the same problem. I do not get a message in cart.

It might also be the case that we have missed fixing this before.

I have set up and created a test site, can you please check if I have missed some steps and try to reproduce the issue there:

- hidden link

Let me know how it goes and if any steps you did.

Thanks,
Drazen

April 22, 2025 at 5:43 am #16953013

desireeM

Do you have WP_DEBUG enabled? If you set a breakpoint on the $cart_item['data']->bundle_data line, does it break there?

If you change
$cart_item['data']->get_type() === 'bundle'
back to
$cart_item['data']->product_type === 'bundle'

do you get a notice? If not, you are doing it wrong and testing it incorrectly, bc that is the code you changed to fix the other issue.

April 22, 2025 at 6:39 am #16953157

Dražen
Supporter

Languages: English (English )

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

Hello,

That fix is already implemented the latest versions of plugins.

Yes, I do have WP Debug enabled and am following the steps you shared with me, but still issue does not happen.

Please go to the test site: hidden link

and try to reproduce the issue and let me know the steps if the issue still happens. There is a debug quick look tool in the top admin bar.

If you still have it on your website, maybe it is related to something else or not using the latest plugin versions.

Regards,
Drazen

April 30, 2025 at 12:17 pm #16983767

desireeM

Can you perhaps answer my question first?

If you change
$cart_item['data']->get_type() === 'bundle'
back to
$cart_item['data']->product_type === 'bundle'

do you get a notice?

May 1, 2025 at 6:27 am #16985632

Dražen
Supporter

Languages: English (English )

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

Hello,

Sure, but I do not understand why I would revert the fix that was implemented in the latest version of WPML plugins? If I revert it and cause the issue, not sure what we will gain from this, since if we use regular latest WPML plugins, there is no issue from my side. We would need to reproduce it like this.

Can you please explain?

Thanks,
Drazen

The topic ‘[Closed] bundle_data was called incorrectly’ is closed to new replies.