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 @@ - _('orders') ?> № + _('orders') ?> №
  • diff --git a/www/index.php b/www/index.php index ad6a34b..cd660a0 100644 --- a/www/index.php +++ b/www/index.php @@ -1396,7 +1396,7 @@ try $router->add ( - '/dealer/print_order/{order:[0-9]+}{language:([/][a-z]{2})?}', + '/dealer/print_order/{order:[0-9]+}/{type}{language:([/][a-z]{2})?}', [ 'controller' => 'dealer', 'action' => 'printOrder' @@ -1415,7 +1415,7 @@ try ->setName('shipment_history'); $router->add ( - '/dealer/shipment_history/{order:[0-9]+}{language:([/][a-z]{2})?}', + '/dealer/shipment_history/{order:[0-9]+}/{type}{language:([/][a-z]{2})?}', [ 'controller' => 'dealer', 'action' => 'singleOrder' -- libgit2 0.21.4