Commit 0526f97aeecb074fdf8eaa08b135a7249d1be9ac
1 parent
746d54c8
price display basket
Showing
1 changed file
with
10 additions
and
5 deletions
Show diff stats
src/app/frontend/controllers/MenuController.php
@@ -189,11 +189,21 @@ class MenuController extends \controllers\ControllerBase | @@ -189,11 +189,21 @@ class MenuController extends \controllers\ControllerBase | ||
189 | $sms_text = "Vash zakaz prinyat. #:".$proposal_number['proposal_number']." V blijayshee vremya menedjer svyajetsya s Vami (044) 581-67-15"; | 189 | $sms_text = "Vash zakaz prinyat. #:".$proposal_number['proposal_number']." V blijayshee vremya menedjer svyajetsya s Vami (044) 581-67-15"; |
190 | $this->sms->sendSMS($order['phone'], $sms_text); | 190 | $this->sms->sendSMS($order['phone'], $sms_text); |
191 | 191 | ||
192 | + //promocode | ||
192 | if(!empty($promo_code)) { | 193 | if(!empty($promo_code)) { |
193 | if($this->common->applyPromoCode($promo_code[0], $order['items'])) | 194 | if($this->common->applyPromoCode($promo_code[0], $order['items'])) |
194 | $this->common->countOrderSum($order); | 195 | $this->common->countOrderSum($order); |
195 | } | 196 | } |
196 | 197 | ||
198 | + //discount | ||
199 | + $discount = $this->getDi()->get('models')->getDiscount()->getActiveData(); | ||
200 | + if (!empty($discount)) { | ||
201 | + $discount = $discount[0]; | ||
202 | + } | ||
203 | + if ($this->common->applyPromoCode($discount, $order['items'])) { | ||
204 | + $this->common->countOrderSum($order); | ||
205 | + } | ||
206 | + | ||
197 | // novaposhta | 207 | // novaposhta |
198 | if (!empty($proposal_number['novaposhta_tnn'])) | 208 | if (!empty($proposal_number['novaposhta_tnn'])) |
199 | { | 209 | { |
@@ -272,7 +282,6 @@ class MenuController extends \controllers\ControllerBase | @@ -272,7 +282,6 @@ class MenuController extends \controllers\ControllerBase | ||
272 | ]); | 282 | ]); |
273 | } | 283 | } |
274 | 284 | ||
275 | - | ||
276 | public function orderCompletedAction() { | 285 | public function orderCompletedAction() { |
277 | $completed = $this->languages->getTranslation()->_("successfully_realized_order"); | 286 | $completed = $this->languages->getTranslation()->_("successfully_realized_order"); |
278 | 287 | ||
@@ -330,7 +339,6 @@ class MenuController extends \controllers\ControllerBase | @@ -330,7 +339,6 @@ class MenuController extends \controllers\ControllerBase | ||
330 | ]); | 339 | ]); |
331 | } | 340 | } |
332 | 341 | ||
333 | - | ||
334 | public function getCitiesAction( ) | 342 | public function getCitiesAction( ) |
335 | { | 343 | { |
336 | header('Content-Type: application/json; charset=utf8'); | 344 | header('Content-Type: application/json; charset=utf8'); |
@@ -358,7 +366,6 @@ class MenuController extends \controllers\ControllerBase | @@ -358,7 +366,6 @@ class MenuController extends \controllers\ControllerBase | ||
358 | die( json_encode( $selected_cities ) ); | 366 | die( json_encode( $selected_cities ) ); |
359 | } | 367 | } |
360 | 368 | ||
361 | - | ||
362 | public function getOfficesAction( ) | 369 | public function getOfficesAction( ) |
363 | { | 370 | { |
364 | header('Content-Type: application/json; charset=utf8'); | 371 | header('Content-Type: application/json; charset=utf8'); |
@@ -379,7 +386,6 @@ class MenuController extends \controllers\ControllerBase | @@ -379,7 +386,6 @@ class MenuController extends \controllers\ControllerBase | ||
379 | die( json_encode( $offices ) ); | 386 | die( json_encode( $offices ) ); |
380 | } | 387 | } |
381 | 388 | ||
382 | - | ||
383 | public function addProductBasketAction(){ | 389 | public function addProductBasketAction(){ |
384 | $item_id = $_GET['productID']; | 390 | $item_id = $_GET['productID']; |
385 | $count_items = $_GET['productCount']; | 391 | $count_items = $_GET['productCount']; |
@@ -446,7 +452,6 @@ class MenuController extends \controllers\ControllerBase | @@ -446,7 +452,6 @@ class MenuController extends \controllers\ControllerBase | ||
446 | echo json_encode($cart_items); | 452 | echo json_encode($cart_items); |
447 | } | 453 | } |
448 | 454 | ||
449 | - | ||
450 | public function addToBasketAction() | 455 | public function addToBasketAction() |
451 | { | 456 | { |
452 | $count = 0; | 457 | $count = 0; |