Define custom order state on shipments
This commit is contained in:
parent
5e48a85d9f
commit
0f4da65937
|
|
@ -70,9 +70,10 @@ class ShipmentRepository extends Repository
|
|||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param string $orderState
|
||||
* @return \Webkul\Sales\Contracts\Shipment
|
||||
*/
|
||||
public function create(array $data)
|
||||
public function create(array $data, $orderState = null)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
|
||||
|
|
@ -155,7 +156,11 @@ class ShipmentRepository extends Repository
|
|||
'inventory_source_name' => $shipment->inventory_source->name,
|
||||
]);
|
||||
|
||||
$this->orderRepository->updateOrderStatus($order);
|
||||
if (isset($orderState)){
|
||||
$this->orderRepository->updateOrderStatus($order, $orderState);
|
||||
} else {
|
||||
$this->orderRepository->updateOrderStatus($order);
|
||||
}
|
||||
|
||||
Event::dispatch('sales.shipment.save.after', $shipment);
|
||||
} catch (\Exception $e) {
|
||||
|
|
@ -168,4 +173,4 @@ class ShipmentRepository extends Repository
|
|||
|
||||
return $shipment;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue