diff --git a/connectors/class-connector-woocommerce.php b/connectors/class-connector-woocommerce.php index 20e8670c..8bf2508c 100644 --- a/connectors/class-connector-woocommerce.php +++ b/connectors/class-connector-woocommerce.php @@ -396,8 +396,8 @@ public function callback_transition_post_status( $new_status, $old_status, $post $action = 'updated'; } - $order = new \WC_Order( $post->ID ); - $order_title = esc_html__( 'Order number', 'stream' ) . ' ' . esc_html( $order->get_order_number() ); + $order_id = \WC_Order_Factory::get_order_id( $post->ID ); + $order_title = esc_html__( 'Order number', 'stream' ) . ' ' . esc_html( $order_id ); $order_type_name = esc_html__( 'order', 'stream' ); $this->log( @@ -495,8 +495,8 @@ public function callback_woocommerce_order_status_changed( $order_id, $old_order 'stream' ); - $order = new \WC_Order( $order_id ); - $order_title = esc_html__( 'Order number', 'stream' ) . ' ' . esc_html( $order->get_order_number() ); + $order_id = \WC_Order_Factory::get_order( $order_id ); + $order_title = esc_html__( 'Order number', 'stream' ) . ' ' . esc_html( $order_id ); $order_type_name = esc_html__( 'order', 'stream' ); $this->log(