Commit 7b24e24ab99a8ed70bdd26927214675f3f12187c
1 parent
b79659ab
products pick
Showing
2 changed files
with
2 additions
and
6 deletions
Show diff stats
src/app/frontend/controllers/PageController.php
| @@ -138,10 +138,7 @@ | @@ -138,10 +138,7 @@ | ||
| 138 | 138 | ||
| 139 | $discount = $this->models->getDiscount()->getActiveData(); | 139 | $discount = $this->models->getDiscount()->getActiveData(); |
| 140 | if (!empty($discount)) { | 140 | if (!empty($discount)) { |
| 141 | - $discount = $discount[0]['discount']; | ||
| 142 | - } | ||
| 143 | - else { | ||
| 144 | - $discount = 0; | 141 | + $discount = $discount[0]; |
| 145 | } | 142 | } |
| 146 | 143 | ||
| 147 | $css = [ | 144 | $css = [ |
src/app/frontend/views/partial/item_group.php
| @@ -33,8 +33,7 @@ | @@ -33,8 +33,7 @@ | ||
| 33 | <div class="align_bottom"> | 33 | <div class="align_bottom"> |
| 34 | <div class="one_item_price"> | 34 | <div class="one_item_price"> |
| 35 | <?= $t->_("price_from") ?> | 35 | <?= $t->_("price_from") ?> |
| 36 | - <?= var_dump($i); ?> | ||
| 37 | - <?php if (isset($discount) && $discount > 0 && $discount <= 100) { | 36 | + <?php if (isset($discount) && $discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($i['group_id'], $discount['group_ids'])) { |
| 38 | echo '<span style="text-decoration: line-through;"><span>'.$i['price'].'</span></span> грн<br/>'; | 37 | echo '<span style="text-decoration: line-through;"><span>'.$i['price'].'</span></span> грн<br/>'; |
| 39 | echo '<span>'.round($i['price']*(1-$discount/100), 1).'</span> грн'; | 38 | echo '<span>'.round($i['price']*(1-$discount/100), 1).'</span> грн'; |
| 40 | } | 39 | } |