Commit 679156e470eb1155fc24efaff5bd9f9c1b66a70a
1 parent
5c35c875
hot fix
Showing
1 changed file
with
14 additions
and
14 deletions
Show diff stats
src/app/frontend/controllers/PageController.php
@@ -1107,24 +1107,24 @@ | @@ -1107,24 +1107,24 @@ | ||
1107 | ]); | 1107 | ]); |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | -// $discount = $this->models->getDiscount()->getActiveData(); | ||
1111 | -// if (!empty($discount)) { | ||
1112 | -// $discount = $discount[0]; | ||
1113 | -// $discount['group_ids'] = str_replace('{', '', $discount['group_ids']); | ||
1114 | -// $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); | ||
1115 | -// $discount['group_ids'] = explode(',', $discount['group_ids']); | ||
1116 | -// if ($discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item_id, $discount['group_ids'])) { | ||
1117 | -// $discount = $discount['discount']; | ||
1118 | -// } | ||
1119 | -// else { | ||
1120 | -// $discount = 0; | ||
1121 | -// } | ||
1122 | -// } | 1110 | + $discount = $this->models->getDiscount()->getActiveData(); |
1111 | + if (!empty($discount)) { | ||
1112 | + $discount = $discount[0]; | ||
1113 | + $discount['group_ids'] = str_replace('{', '', $discount['group_ids']); | ||
1114 | + $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); | ||
1115 | + $discount['group_ids'] = explode(',', $discount['group_ids']); | ||
1116 | + if ($discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item_id, $discount['group_ids'])) { | ||
1117 | + $discount = $discount['discount']; | ||
1118 | + } | ||
1119 | + else { | ||
1120 | + $discount = 0; | ||
1121 | + } | ||
1122 | + } | ||
1123 | 1123 | ||
1124 | $this->view->pick('page/changeWithSize'); | 1124 | $this->view->pick('page/changeWithSize'); |
1125 | $this->view->setVars([ | 1125 | $this->view->setVars([ |
1126 | 'item' => $item['0'], | 1126 | 'item' => $item['0'], |
1127 | - //'discount' => $discount | 1127 | + 'discount' => $discount |
1128 | ]); | 1128 | ]); |
1129 | $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); | 1129 | $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); |
1130 | } | 1130 | } |