Commit ab0adb457845d98ac9877c7e2a147bbfc0539c11

Authored by Administrator
1 parent e942e0f3

add local config

src/app/frontend/controllers/DealerController.php
... ... @@ -674,6 +674,7 @@ class DealerController extends \controllers\ControllerBase
674 674 }
675 675  
676 676 $this->view->setVar('orders', $orders);
  677 + $this->view->setVar('type', 'shipment_history');
677 678 }
678 679  
679 680 $this->view->pick('dealer/onlineOrderHistory');
... ... @@ -700,18 +701,19 @@ class DealerController extends \controllers\ControllerBase
700 701 }
701 702  
702 703 $this->view->setVar('orders', $orders);
  704 + $this->view->setVar('type', 'online_order_history');
703 705 }
704 706  
705 707 $this->view->pick('dealer/onlineOrderHistory');
706 708 }
707 709  
708   - public function singleOrderAction($order_id) {
709   - $this->getOrder($order_id);
  710 + public function singleOrderAction($order_id,$type) {
  711 + $this->getOrder($order_id,$type);
710 712 }
711 713  
712   - public function printOrderAction($order_id) {
  714 + public function printOrderAction($order_id,$type) {
713 715 $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
714   - $this->getOrder($order_id);
  716 + $this->getOrder($order_id,$type);
715 717 }
716 718  
717 719 public function wholesalePricesAction() {
... ... @@ -1649,8 +1651,13 @@ class DealerController extends \controllers\ControllerBase
1649 1651 $this->view->setVar('sum_paid', $sum_paid);
1650 1652 }
1651 1653  
1652   - private function getOrder( $order_id ) {
1653   - $items = $this->models->getOrders()->getOrdersByOrderId( $order_id, $this->lang_id );
  1654 + private function getOrder( $order_id, $type ) {
  1655 + if($type == 'online_order_history'){
  1656 + $items = $this->models->getOrders1C()->getOrdersByOrderId( $order_id, $this->lang_id );
  1657 + } else if($type == 'shipment_history'){
  1658 + $items = $this->models->getShipments()->getOrdersByOrderId( $order_id, $this->lang_id );
  1659 + }
  1660 +
1654 1661  
1655 1662 $order['groups'] = $this->getGroups($items);
1656 1663 $order['total_price'] = 0;
... ...
src/app/frontend/views/dealer/onlineOrderHistory.php
... ... @@ -13,7 +13,7 @@
13 13 </tr>
14 14 <?php foreach($orders as $o): ?>
15 15 <tr>
16   - <td><a href="<?= $this->seoUrl->setUrl($this->router->getRewriteUri().'/'.$o['id']) ?>"><?= $t->_('orders') ?> №<?= $o['id'] ?></a></td>
  16 + <td><a href="<?= $this->seoUrl->setUrl($this->router->getRewriteUri().'/'.$o['id'].'/'.$type) ?>"><?= $t->_('orders') ?> №<?= $o['id'] ?></a></td>
17 17 <td id="greytd" align="center">
18 18 <li class="order_status <?= $o['status'][1] ?>"><?= $o['status'][0] ?></li>
19 19 </td>
... ...
www/index.php
... ... @@ -1396,7 +1396,7 @@ try
1396 1396  
1397 1397 $router->add
1398 1398 (
1399   - '/dealer/print_order/{order:[0-9]+}{language:([/][a-z]{2})?}',
  1399 + '/dealer/print_order/{order:[0-9]+}/{type}{language:([/][a-z]{2})?}',
1400 1400 [
1401 1401 'controller' => 'dealer',
1402 1402 'action' => 'printOrder'
... ... @@ -1415,7 +1415,7 @@ try
1415 1415 ->setName('shipment_history');
1416 1416 $router->add
1417 1417 (
1418   - '/dealer/shipment_history/{order:[0-9]+}{language:([/][a-z]{2})?}',
  1418 + '/dealer/shipment_history/{order:[0-9]+}/{type}{language:([/][a-z]{2})?}',
1419 1419 [
1420 1420 'controller' => 'dealer',
1421 1421 'action' => 'singleOrder'
... ...