Title: wc_doing_it_wrong
Last modified: July 12, 2024

---

# wc_doing_it_wrong

 *  Resolved [slservice33](https://wordpress.org/support/users/slservice33/)
 * (@slservice33)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/wc_doing_it_wrong-2/)
 * Hi, looks like according to query monitor, search exclude is calling function
   ID incorrectly:
 * Function ID was called incorrectly. Order properties should not be accessed directly.
   Backtrace: do_action(‘woocommerce_page_wc-orders’), WP_Hook->do_action, WP_Hook-
   >apply_filters, Automattic\WooCommerce\Internal\Admin\Orders\PageController->
   output, Automattic\WooCommerce\Internal\Admin\Orders\Edit->display, Automattic\
   WooCommerce\Internal\Admin\Orders\Edit->render_meta_boxes, do_meta_boxes, QuadLayers\
   SearchExclude\Plugin->metabox, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong(
   This message was added in version 3.0.)
 * Thanks
   Stephen

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [jmatiasmastro](https://wordpress.org/support/users/jmatiasmastro/)
 * (@jmatiasmastro)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wc_doing_it_wrong-2/#post-17893543)
 * Hello Stephen,
 * Please share some screenshots to describe your issue.
 * You can use this tool to copy/paste your screenshots here easily: [https://snipboard.io](https://snipboard.io/)
   
   Best regards, QuadLayers Support Team
 *  Thread Starter [slservice33](https://wordpress.org/support/users/slservice33/)
 * (@slservice33)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/wc_doing_it_wrong-2/#post-18029200)
 * Hi, the issue is that I get this PHP error when I edit woocommerce orders with
   search exclude plugin active.
   When I turn off search exclude plugin the error
   is not there and using query monitor the backtrace is to :
 * `Automattic\WooCommerce\Internal\Admin\Orders\Edit->render_meta_boxes, do_meta_boxes,
   QuadLayers\QLSE\Controllers\Backend->metabox`
 * I’ve googled the issue and apparently its from accessing Object properties directly,
   instead use `WC_Order` methods and replace:
    - `$order->status` by  `$order->get_status()`
    - `$order->total` by `$order->get_total()`

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wc_doing_it_wrong’ is closed to new replies.

 * ![](https://ps.w.org/search-exclude/assets/icon-256x256.png?rev=2916925)
 * [Search Exclude](https://wordpress.org/plugins/search-exclude/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/search-exclude/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/search-exclude/)
 * [Active Topics](https://wordpress.org/support/plugin/search-exclude/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/search-exclude/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/search-exclude/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [slservice33](https://wordpress.org/support/users/slservice33/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/wc_doing_it_wrong-2/#post-18029200)
 * Status: resolved