Skip to content

Commit

Permalink
🛠️ [FIX] Get order permalink.
Browse files Browse the repository at this point in the history
  • Loading branch information
RatulHasan committed Nov 29, 2023
1 parent 96b0fd1 commit 3277202
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public function blueprint( $order ) {
if ( $this->is_refund( $data['type'] ) ) {
/** @var $order \Automattic\WooCommerce\Admin\Overrides\OrderRefund */
$data['customer_id'] = $this->get_customer_id( wc_get_order( $order->get_parent_id() )->get_billing_email() );
$data['permalink'] = get_edit_post_link( $order->get_parent_id(), 'raw' );
$data['permalink'] = wc_get_order( $order->get_parent_id() )->get_edit_order_url();
$data['completed_at'] = $order->get_date_modified()->setTimezone( new DateTimeZone( 'UTC' ) )->format( self::DATE_FORMAT );
} else {
$data['customer'] = $this->customer( $order );
$data['permalink'] = get_edit_post_link( $order->get_id(), 'raw' );
$data['permalink'] = $order->get_edit_order_url();
$data['customer_id'] = $this->get_customer_id( $data['customer']['email'] );
$completed_date = $order->get_date_completed();
$data['completed_at'] = $completed_date && $this->is_completed( $this->get_status( $order->get_status() ) ) ? $completed_date->setTimezone( new DateTimeZone( 'UTC' ) )->format( self::DATE_FORMAT ) : null;
Expand Down

0 comments on commit 3277202

Please sign in to comment.