Skip to content

Commit

Permalink
Replace WC_Order with WC_Order_Factory to get order ID
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinkrzeminski committed Dec 20, 2024
1 parent eb21a2f commit 26bc5c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions connectors/class-connector-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 26bc5c9

Please sign in to comment.