diff --git a/src/app/frontend/controllers/DealerController.php b/src/app/frontend/controllers/DealerController.php index 9ded13f..b21cc2c 100644 --- a/src/app/frontend/controllers/DealerController.php +++ b/src/app/frontend/controllers/DealerController.php @@ -674,6 +674,7 @@ class DealerController extends \controllers\ControllerBase } $this->view->setVar('orders', $orders); + $this->view->setVar('type', 'shipment_history'); } $this->view->pick('dealer/onlineOrderHistory'); @@ -700,18 +701,19 @@ class DealerController extends \controllers\ControllerBase } $this->view->setVar('orders', $orders); + $this->view->setVar('type', 'online_order_history'); } $this->view->pick('dealer/onlineOrderHistory'); } - public function singleOrderAction($order_id) { - $this->getOrder($order_id); + public function singleOrderAction($order_id,$type) { + $this->getOrder($order_id,$type); } - public function printOrderAction($order_id) { + public function printOrderAction($order_id,$type) { $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); - $this->getOrder($order_id); + $this->getOrder($order_id,$type); } public function wholesalePricesAction() { @@ -1649,8 +1651,13 @@ class DealerController extends \controllers\ControllerBase $this->view->setVar('sum_paid', $sum_paid); } - private function getOrder( $order_id ) { - $items = $this->models->getOrders()->getOrdersByOrderId( $order_id, $this->lang_id ); + private function getOrder( $order_id, $type ) { + if($type == 'online_order_history'){ + $items = $this->models->getOrders1C()->getOrdersByOrderId( $order_id, $this->lang_id ); + } else if($type == 'shipment_history'){ + $items = $this->models->getShipments()->getOrdersByOrderId( $order_id, $this->lang_id ); + } + $order['groups'] = $this->getGroups($items); $order['total_price'] = 0; diff --git a/src/app/frontend/views/dealer/onlineOrderHistory.php b/src/app/frontend/views/dealer/onlineOrderHistory.php index 38b8fac..8dd3cc0 100644 --- a/src/app/frontend/views/dealer/onlineOrderHistory.php +++ b/src/app/frontend/views/dealer/onlineOrderHistory.php @@ -13,7 +13,7 @@