Support » Plugin: WooCommerce » id was called incorrectly

  • Resolved Ber Moolenaar-Thomas

    (@ber-moolenaar)


    I have two errors in my error.log, how and where can I fix this?

    [14-Nov-2021 10:35:19 UTC] id was called incorrectly. Order 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_checkout'), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->process_order_payment, WC_Gateway_BACS->process_payment, WC_Order->update_status, WC_Order->save, WC_Order->status_transition, do_action('woocommerce_order_status_pending_to_on-hold'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Emails::send_transactional_email, do_action_ref_array('woocommerce_order_status_pending_to_on-hold_notification'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Email_New_Order->trigger, WC_Email->get_content, WC_Email_New_Order->get_content_html, wc_get_template_html, wc_get_template, include('/themes/PRA/woocommerce/emails/admin-new-order.php'), do_action('woocommerce_email_order_meta'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Emails->order_meta, apply_filters('woocommerce_email_order_meta_fields'), WP_Hook->apply_filters, add_dates_to_email, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong. This message was added in version 3.0.
    
    [14-Nov-2021 10:35:19 UTC] id was called incorrectly. Order 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_checkout'), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->process_order_payment, WC_Gateway_BACS->process_payment, WC_Order->update_status, WC_Order->save, WC_Order->status_transition, do_action('woocommerce_order_status_pending_to_on-hold'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Emails::send_transactional_email, do_action_ref_array('woocommerce_order_status_pending_to_on-hold_notification'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Email_Customer_On_Hold_Order->trigger, WC_Email->get_content, WC_Email_Customer_On_Hold_Order->get_content_html, wc_get_template_html, wc_get_template, include('/plugins/kadence-woocommerce-email-designer/templates/woo/emails/customer-on-hold-order.php'), do_action('woocommerce_email_order_meta'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Emails->order_meta, apply_filters('woocommerce_email_order_meta_fields'), WP_Hook->apply_filters, add_dates_to_email, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong. This message was added in version 3.0.
Viewing 6 replies - 1 through 6 (of 6 total)
  • you have a function custom add_dates_to_email() somewhere and this function and here you’re using deprecated way of accessing order id.

    find the function and use the get_id function to fetch the order id.

    your old code will be like this $oder->id and you’ll have to use $order->get_id() to fix it.

    Thread Starter Ber Moolenaar-Thomas

    (@ber-moolenaar)

    In which file must it be?
    I checked ‘/plugins/kadence-woocommerce-email-designer/templates/woo/emails/customer-on-hold-order.php’ and ‘/themes/PRA/woocommerce/emails/admin-new-order.php’ and it’s not in those files.

    Hi @ber-moolenaar,

    Try disabling the /woocommerce/emails/admin-new-order.php file in the theme and see if you still have the problem. If you don’t, then that will narrow this down

    Let us know what you find out.

    Take care

    Hi @ber-moolenaar

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.

    Thread Starter Ber Moolenaar-Thomas

    (@ber-moolenaar)

    Thanks that worked, I changed the file.

    Hello there,

    That’s perfect, thanks for letting us know!

    I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘id was called incorrectly’ is closed to new replies.