Merge pull request #4835 from bagisto-europe/update_order
Define a custom order status
This commit is contained in:
commit
9e2e54af5c
|
|
@ -304,18 +304,22 @@ class OrderRepository extends Repository
|
|||
* @param \Webkul\Sales\Contracts\Order $order
|
||||
* @return void
|
||||
*/
|
||||
public function updateOrderStatus($order)
|
||||
public function updateOrderStatus($order, $orderState = null)
|
||||
{
|
||||
$status = 'processing';
|
||||
if (!empty($orderState)) {
|
||||
$status = $orderState;
|
||||
} else {
|
||||
$status = "processing";
|
||||
|
||||
if ($this->isInCompletedState($order)) {
|
||||
$status = 'completed';
|
||||
}
|
||||
if ($this->isInCompletedState($order)) {
|
||||
$status = 'completed';
|
||||
}
|
||||
|
||||
if ($this->isInCanceledState($order)) {
|
||||
$status = 'canceled';
|
||||
} elseif ($this->isInClosedState($order)) {
|
||||
$status = 'closed';
|
||||
if ($this->isInCanceledState($order)) {
|
||||
$status = 'canceled';
|
||||
} elseif ($this->isInClosedState($order)) {
|
||||
$status = 'closed';
|
||||
}
|
||||
}
|
||||
|
||||
$order->status = $status;
|
||||
|
|
|
|||
Loading…
Reference in New Issue