Commit 9e135b2d7e17446b92e6d7bb42ed40f635768be8

Authored by Alex Savenko
1 parent c818f7ad

add vip to menu controller

Showing 1 changed file with 12 additions and 0 deletions   Show diff stats
src/app/frontend/controllers/MenuController.php
... ... @@ -210,6 +210,18 @@ class MenuController extends \controllers\ControllerBase
210 210 if ($this->common->applyPromoCode($discount, $order['items'])) {
211 211 $this->common->countOrderSum($order);
212 212 }
  213 + //vip
  214 + $users_group_id = $this->session->get('users_group_id');
  215 + $users_group_discount = $this->getDi()->get('models')->getUsersGroup()->getOneData($users_group_id);
  216 + if (!empty($users_group_discount[0]['discount']) && $users_group_discount[0]['discount'] < 100 && $users_group_discount[0]['discount'] > 0) {
  217 + $users_group_discount = $users_group_discount[0]['discount'];
  218 + }
  219 + else {
  220 + $users_group_discount = 0;
  221 + }
  222 + if ($this->common->applyPromoCode($users_group_discount, $order['items'])) {
  223 + $this->common->countOrderSum($order);
  224 + }
213 225  
214 226 // save order
215 227 $proposal_number = $this->models->getOrders()->addOrder($order);
... ...