• Resolved Ambyomoron

    (@josiah-s-carberry)


    I am looking for an explanation of the syntax of the error message of the type “wc_doing_it_wrong”.

    I get the following message:

    FastCGI: server "/home/.config/apache/mysite.com/.fpm/php5.external" stderr: PHP message: post 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, WC_AJAX::do_wc_ajax, do_action('wc_ajax_update_order_review'), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::update_order_review, woocommerce_order_review, wc_get_template, include('/themes/mytheme/woocommerce/checkout/review-order.php'), WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0., referer: https://www.mysite.com/checkout/?add-to-cart=9999

    I understand from this message that there is an error in the file review-order.php, where the expression WC_Abstract_Legacy_Product->__get is used incorrectly. But my understanding is not correct, because that file does not contain that expression. So how am I to understand this message?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Look for $product->post or something similar.

    Thread Starter Ambyomoron

    (@josiah-s-carberry)

    Thank you, but this was not my question. I am trying to understand how to interpret the message (for future reference); not how to fix the problem.

    post was called directly on a WC_Abstract_Legacy_Product object. E.g. $any_product_variable->post.

    This happend during include('/themes/mytheme/woocommerce/checkout/review-order.php')

    The message contains a backtrace of the call stack.

    This specific message was added in v3.0 of the plugin.

    The error occured when someone browsed https://www.mysite.com/checkout/?add-to-cart=9999

    Joel Williams

    (@joelwills)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Syntax of wc_doing_it_wrong message’ is closed to new replies.