diff --git a/includes/Admin/STE_Metabox.php b/includes/Admin/STE_Metabox.php index 9e4d865..7311830 100644 --- a/includes/Admin/STE_Metabox.php +++ b/includes/Admin/STE_Metabox.php @@ -18,7 +18,7 @@ class STE_Metabox { /** - * Hold all shipping information for eCourier. + * Holds all shipping information for eCourier. * * @var array */ @@ -58,9 +58,14 @@ public function metabox_view_handler() { wp_enqueue_style( 'ste-admin-styles' ); wp_enqueue_script( 'ste-admin-script' ); - // Set all necessary Shipping Information. - $this->set_shipping_info( $theorder ); + $order_shipped = ste_get_order_shipping_info( $theorder->get_order_number() ); + if ( ! $order_shipped ) { + // Set all necessary Shipping Information. + $this->set_shipping_info( $theorder ); + } else { + $order_shipped->user = get_user_by( 'ID', $order_shipped->created_by )->display_name; + } // Load the parcel booking form/view. if ( ! file_exists( __DIR__ . '/views/ste-booking-metabox-view.php' ) ) { diff --git a/includes/Admin/views/ste-booking-metabox-view.php b/includes/Admin/views/ste-booking-metabox-view.php index 108461e..e3824b0 100644 --- a/includes/Admin/views/ste-booking-metabox-view.php +++ b/includes/Admin/views/ste-booking-metabox-view.php @@ -8,6 +8,7 @@ ?>