diff --git a/src/app/frontend/controllers/PageController.php b/src/app/frontend/controllers/PageController.php index 83f72cd..096a347 100644 --- a/src/app/frontend/controllers/PageController.php +++ b/src/app/frontend/controllers/PageController.php @@ -1091,10 +1091,25 @@ 'special_user' => $special_user ]); } + + $discount = $this->models->getDiscount()->getActiveData(); + if (!empty($discount)) { + $discount = $discount[0]; + $discount['group_ids'] = str_replace('{', '', $discount['group_ids']); + $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); + $discount['group_ids'] = explode(',', $discount['group_ids']); + if ($discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item_id, $discount['group_ids'])) { + $discount = $discount['discount']; + } + else { + $discount = 0; + } + } $this->view->pick('page/changeWithSize'); $this->view->setVars([ - 'item' => $item['0'] + 'item' => $item['0'], + 'discount' => $discount ]); $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); } diff --git a/src/app/frontend/views/page/changeWithSize.php b/src/app/frontend/views/page/changeWithSize.php index 144a9cc..154fdd5 100644 --- a/src/app/frontend/views/page/changeWithSize.php +++ b/src/app/frontend/views/page/changeWithSize.php @@ -8,7 +8,7 @@ if(isset($special_user)) { } $data['html'] = '