I’m building a plugin that applies a Woocommerce product discount on the checkout page, but am getting the following errors:
**Notice** : Function id was called incorrectly. Product properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/pro/framework/legacy/templates/page.php'), x_get_view, x_render_view, include('/themes/pro/framework/views/integrity/wp-page.php'), x_get_view, x_render_view, include('/themes/pro/framework/views/integrity/content-page.php'), x_get_view, x_render_view, include('/themes/pro/framework/views/global/_content.php'), x_get_view, x_render_view, include('/themes/pro/framework/views/global/_content-the-content.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, WC_Shortcodes::checkout, WC_Shortcodes::shortcode_wrapper, WC_Shortcode_Checkout::output, WC_Shortcode_Checkout::checkout, wc_get_template, include('/plugins/woocommerce/templates/checkout/form-checkout.php'), WC_Checkout->get_checkout_fields, apply_filters('woocommerce_checkout_fields') in **/home/sites/8b/c/c60f749114/staging_html/wp-includes/functions.php** on line **6078**
I’m not actually calling thesw directly, because I’m going through the woocommerce_cart_calculate_fees
hook which is the correct way of doing this.
This problem disappears when I switch theme to one of the Wordpress themes (such as Twenty Twenty Four). Can you shed any light on why this is happening?Are the Woocommerce actions/hooks being overriden by Themeco ones? Should i be calling a Themeco action hook?
I couldn’t find anything in the developer documentation, but I thought I’d ask as I’ve previously found things not documented, by searching through the code.
Can you help?