fix yd yiwu warehouse selection

This commit is contained in:
omair saleh
2022-02-28 10:51:57 +08:00
parent 34532d0f68
commit 0ef2c9bf6d
@@ -66,7 +66,7 @@ class CreateOrderLogic extends AbstractControllerLogic
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $request->input('warehouse_id')]);
$originWarehouse = $originWarehouse->reference === WarehouseReferences::VT_GUANG_ZHOU ? $this->fetchesCompanyModule->execute(['reference' => in_array($company->id, [2376]) ? WarehouseReferences::VT_GUANG_ZHOU : WarehouseReferences::YD_GUANG_ZHOU]) : $this->fetchesCompanyModule->execute(['reference' => $company->id === WarehouseReferences::YD_YIWU]);
$originWarehouse = $originWarehouse->reference === WarehouseReferences::VT_GUANG_ZHOU ? $this->fetchesCompanyModule->execute(['reference' => in_array($company->id, [2376]) ? WarehouseReferences::VT_GUANG_ZHOU : WarehouseReferences::YD_GUANG_ZHOU]) : $this->fetchesCompanyModule->execute(['reference' => WarehouseReferences::YD_YIWU]);
if($originWarehouse->reference === WarehouseReferences::YD_YIWU && in_array($address->state_id, [5, 13, 14])) {
throw new RequestValidationException('Our Yiwu warehouse is unable to ship goods to Sabah & Sarawak at the moment due to the chinese new year\'s holiday. you can select our Guangzhou warehouse as an alternative.');