• amila

    (@flatworld21)


    Hi, I got an error.
    Fatal error: Uncaught exception ‘Exception’ with message ‘Invalid order.’ in plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php:89
    Stack trace: #0
    plugins/woocommerce/includes/class-wc-data-store.php(147): Abstract_WC_Order_Data_Store_CPT->read(Object(WC_Order)) #1
    plugins/woocommerce/includes/abstracts/abstract-wc-order.php(109): WC_Data_Store->read(Object(WC_Order)) #2
    wp-content/plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php on line 89

    found this wp-content/plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php 89 line

    		if ( ! $order->get_id() || ! ( $post_object = get_post( $order->get_id() ) ) || ! in_array( $post_object->post_type, wc_get_order_types() ) ) {
    			throw new Exception( __( 'Invalid order.', 'woocommerce' ) );
    		}

    reason:
    $post_object->post_type = “product”
    but wc_get_order_types() are
    Array ( [0] => shop_order [1] => shop_order_refund )

    How to solve this problem?

    • This topic was modified 8 years, 9 months ago by amila.

The topic ‘Fatal error: Uncaught exception ‘Exception’ with message ‘Invalid order.’’ is closed to new replies.