Commit aec684fa02a9d5085d29e3e3eb00fe883301bbba
Merge branch 'discount' of gitlab.artweb.com.ua:Alex/semena
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 | 447 | //discount |
448 | 448 | $cart_items['items'][$k]['price'] = round($cart_items['items'][$k]['price']*(1-$discount['discount']/100), 1); |
449 | 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 | 203 | <ul> |
204 | 204 | <li> |
205 | 205 | <?php |
206 | + // скидка | |
206 | 207 | if (!empty($discount)) { |
207 | 208 | if (isset($discount) && $discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item['id'], $discount['group_ids'])) { |
208 | 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 | 215 | else { |
212 | 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 | 34 | <div class="one_item_price"> |
35 | 35 | <?= $t->_("price_from") ?> |
36 | 36 | <?php |
37 | + // скидка | |
37 | 38 | if (!empty($discount)) { |
38 | 39 | if ($discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($i['id'], $discount['group_ids'])) { |
39 | 40 | echo '<span style="text-decoration: line-through;"><span>'.$i['price'].'</span></span> грн<br/>'; | ... | ... |