// The backend order module have no function to create a new order so an order id must be passed.
if (!
($order instanceof Order
)) { $this->
View()->
assign([ 'success' => false,
'data' =>
$this->
Request()->
getParams(),
'message' =>
$namespace->
get('no_order_id_passed', 'No valid order id passed.'
),
]);
return;
} $billing =
$order->
getBilling();
$shipping =
$order->
getShipping();
// Check if the shipping and billing model already exist. If not create a new instance.
if (!
$shipping instanceof Shipping
) { $shipping =
new Shipping();
} if (!
$billing instanceof Billing
) { $billing =
new Billing();
} // Get all passed order data