Commit 903c98f77e93adeb39f932ef6c54e6828042792e
1 parent
2f19c256
price display
Showing
3 changed files
with
6 additions
and
1 deletions
Show diff stats
src/app/frontend/controllers/MenuController.php
@@ -447,7 +447,7 @@ class MenuController extends \controllers\ControllerBase | @@ -447,7 +447,7 @@ class MenuController extends \controllers\ControllerBase | ||
447 | //discount | 447 | //discount |
448 | $cart_items['items'][$k]['price'] = round($cart_items['items'][$k]['price']*(1-$discount['discount']/100), 1); | 448 | $cart_items['items'][$k]['price'] = round($cart_items['items'][$k]['price']*(1-$discount['discount']/100), 1); |
449 | $cart_items['items'][$k]['total_price'] = round($cart_items['items'][$k]['total_price']*(1-$discount['discount']/100), 1); | 449 | $cart_items['items'][$k]['total_price'] = round($cart_items['items'][$k]['total_price']*(1-$discount['discount']/100), 1); |
450 | - //$cart_items['total_price'] = round($cart_items['total_price']*(1-$discount['discount']/100), 1); | 450 | + $cart_items['total_price'] = round($cart_items['total_price']*(1-$discount['discount']/100), 1); |
451 | } | 451 | } |
452 | } | 452 | } |
453 | 453 |
src/app/frontend/views/page/item.php
@@ -203,10 +203,14 @@ | @@ -203,10 +203,14 @@ | ||
203 | <ul> | 203 | <ul> |
204 | <li> | 204 | <li> |
205 | <?php | 205 | <?php |
206 | + // скидка | ||
206 | if (!empty($discount)) { | 207 | if (!empty($discount)) { |
207 | if (isset($discount) && $discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item['id'], $discount['group_ids'])) { | 208 | if (isset($discount) && $discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item['id'], $discount['group_ids'])) { |
208 | echo '<span itemprop="price">'.number_format($item['price2']*(1-$discount['discount']/100), 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; | 209 | echo '<span itemprop="price">'.number_format($item['price2']*(1-$discount['discount']/100), 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; |
209 | } | 210 | } |
211 | + else { | ||
212 | + echo '<span itemprop="price">'.number_format($item['price2'], 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; | ||
213 | + } | ||
210 | } | 214 | } |
211 | else { | 215 | else { |
212 | echo '<span itemprop="price">'.number_format($item['price2'], 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; | 216 | echo '<span itemprop="price">'.number_format($item['price2'], 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; |
src/app/frontend/views/partial/item_group.php
@@ -34,6 +34,7 @@ | @@ -34,6 +34,7 @@ | ||
34 | <div class="one_item_price"> | 34 | <div class="one_item_price"> |
35 | <?= $t->_("price_from") ?> | 35 | <?= $t->_("price_from") ?> |
36 | <?php | 36 | <?php |
37 | + // скидка | ||
37 | if (!empty($discount)) { | 38 | if (!empty($discount)) { |
38 | if ($discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($i['id'], $discount['group_ids'])) { | 39 | if ($discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($i['id'], $discount['group_ids'])) { |
39 | echo '<span style="text-decoration: line-through;"><span>'.$i['price'].'</span></span> грн<br/>'; | 40 | echo '<span style="text-decoration: line-through;"><span>'.$i['price'].'</span></span> грн<br/>'; |