Skip Navigation

[Waiting for user feedback] WooCommerce Views accessing Product incorrectly

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 1 voice.

Last updated by Minesh 13 hours, 12 minutes ago.

Assisted by: Minesh.

Author
Posts
#2794612

I am trying to:
This happens on any access of the website.

Link to a page where the issue can be seen:
There's nothing to see but the following is logged in debug.log if debugging is on:

[29-Jan-2025 19:16:53 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-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, WooViews\Templates\Loader->override, WooViews\Templates\Loader->load, include_once('/plugins/woocommerce-views/library/toolset/woocommerce-views/templates/single-product.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, sb_variable_product_message, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong

Is this a known issue that is being worked on?

#2794651

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The error you shared is a PHP notice that will not stop execution of your site.

However - I see you are using number of third-party plugin. In order to minimize the cause of the issue and to ensure there is no conflict with the plugins/theme you use:

Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes?
- Do you see any difference?

#2794715

No other plugin or theme is going to change code in WooCommerce Views where you access product fields the outdated way noted in the warning message. I didn't send this looking for a fix for a current problem. I am worried that WooCommerce may remove support for this kind of access instead of just issuing a warning at some point in the future and I'd like to know if Toolset is working to update your code so that sites are not broken when / if that happens.

#2795179

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I do not see any other user reported the issue as well as I'm not sure on what page/post and with what configuration you get that PHP notice.

I'll keep eye on this notice and if any other user reported the same notice I will check with our concern team what steps we will require in order to fix this notice.

If you can share details on what page/post I can see the notice and with what configuration it would be great.

I have set the next reply to private which means only you and I have access to it.