Commit 525b93c3215da0a0c8652365e524f310c0e2e4b3

Authored by Alex Savenko
2 parents 4d3c546a ff60c4df

Merge branch 'discount' of gitlab.artweb.com.ua:Alex/semena

src/app/frontend/views/page/item.php
... ... @@ -203,8 +203,10 @@
203 203 <ul>
204 204 <li>
205 205 <?php
206   - if (isset($discount) && $discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item['id'], $discount['group_ids'])) {
207   - echo '<span itemprop="price">'.number_format($item['price2']*(1-$discount['discount']/100), 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>';
  206 + if (!empty($discount)) {
  207 + 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 + }
208 210 }
209 211 else {
210 212 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
... ... @@ -33,9 +33,12 @@
33 33 <div class="align_bottom">
34 34 <div class="one_item_price">
35 35 <?= $t->_("price_from") ?>
36   - <?php if (isset($discount) && $discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($i['id'], $discount['group_ids'])) {
37   - echo '<span style="text-decoration: line-through;"><span>'.$i['price'].'</span></span> грн<br/>';
38   - echo '<span>'.round($i['price']*(1-$discount['discount']/100), 1).'</span> грн';
  36 + <?php
  37 + if (!empty($discount)) {
  38 + 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>'.round($i['price']*(1-$discount['discount']/100), 1).'</span> грн';
  41 + }
39 42 }
40 43 else {
41 44 echo '<span>'.$i['price'].'</span> грн';
... ...