Support » Plugin: WooCommerce » WooCommerce 3.0.1 Update – Error with Custom Post Type

  • Resolved bk_design

    (@bk_design)


    Hi,

    I have a custom post type called “events” and since I updated WooCommerce to 3.0.1 I am getting this error message when I try to edit the post (event).

    Fatal error: Uncaught exception 'Exception' with message 'Invalid order.' in /home/mirac22/public_html/wp-content/plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php:86 Stack trace: #0 /home/mirac22/public_html/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(143): Abstract_WC_Order_Data_Store_CPT->read(Object(WC_Order)) #1 /home/mirac22/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(109): WC_Data_Store->read(Object(WC_Order)) #2 /home/mirac22/public_html/wp-content/plugins/easypost-woocommerce-shipping/includes/class-wf-shipping-easypost-admin.php(818): WC_Abstract_Order->__construct('1229') #3 /home/mirac22/public_html/wp-content/plugins/easypost-woocommerce-shipping/includes/class-wf-shipping-easypost-admin.php(96): WF_Shipping_Easypost_Admin->wf_load_order('1229') #4 [internal function]: WF_Shipping_Easypost_Admin->wf_add_easypost_metabox('events') #5 /home/mirac22/public_html/wp-includes/class-wp-hook.php(300): call_user_func_array(Array, A in /home/mirac22/public_html/wp-content/plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php on line 86

    I have already updated EasyPost WooCommerce Shipping. It appears the conflict is with the abstract-wc-order-data-store-cpt.php file?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Are events a type of order? Why would it be trying to get a WC_Order with the ID of an event? Would have to be in that codebase somewhere. Orders check that the post type is ‘order’ or throw exception.

    easypost-woocommerce-shipping is the one making the call it seems.

    Thread Starter bk_design

    (@bk_design)

    I checked with EasyPost and they claimed the last update should have resolved the issue and it hasn’t. I will reach out them again. I did just notice this is also happening when I try to edit the product page. I am getting the same error message.

    Fatal error: Uncaught exception 'Exception' with message 'Invalid order.' in /home/mirac22/public_html/wp-content/plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php:86 Stack trace: #0 /home/mirac22/public_html/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(143): Abstract_WC_Order_Data_Store_CPT->read(Object(WC_Order)) #1 /home/mirac22/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(109): WC_Data_Store->read(Object(WC_Order)) #2 /home/mirac22/public_html/wp-content/plugins/easypost-woocommerce-shipping/includes/class-wf-shipping-easypost-admin.php(818): WC_Abstract_Order->__construct('494') #3 /home/mirac22/public_html/wp-content/plugins/easypost-woocommerce-shipping/includes/class-wf-shipping-easypost-admin.php(96): WF_Shipping_Easypost_Admin->wf_load_order('494') #4 [internal function]: WF_Shipping_Easypost_Admin->wf_add_easypost_metabox('product') #5 /home/mirac22/public_html/wp-includes/class-wp-hook.php(300): call_user_func_array(Array, Ar in /home/mirac22/public_html/wp-content/plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php on line 86

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Yeah same plugin. Is this a free addon I can view the source somewhere?

    Thread Starter bk_design

    (@bk_design)

    EasyPost isn’t a free plugin. I can wait until I hear back from them and let you know what they say.

    I got same error “Invalid order.” today when updated WooCommerce to version 3.0.1. But not sure it’s related to any custom post types.

    PHP Fatal error:  Uncaught exception 'Exception' with message 'Invalid order.' in /var/www/projectx/src/wp-content/plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php:86
    Stack trace:
    #0 /var/www/projectx/src/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(143): Abstract_WC_Order_Data_Store_CPT->read(Object(WC_Order))
    #1 /var/www/projectx/src/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(109): WC_Data_Store->read(Object(WC_Order))
    #2 /var/www/projectx/src/wp-content/themes/projectx/ProjectXController.php(72): WC_Abstract_Order->__construct(10183)

    It seems that if I try to get Wc_Order too early- it creates that error.

    $order = new WC_Order( $orderId );

    I tried to get order in hook “after_setup_theme”. I got it working by moving my code to be executed bit later. In hook “wp_loaded” there was no such error anymore. ( https://codex.wordpress.org/Plugin_API/Action_Reference )

    Also I discovered that (ups-woocommerce-shipping) made also this error.

    Thread Starter bk_design

    (@bk_design)

    Upgrading EasyPost to Version 1.5.5 resolved the conflict with WooCommerce 3.0.1. Everything is working now.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WooCommerce 3.0.1 Update – Error with Custom Post Type’ is closed to new replies.