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,8 +203,10 @@
203 <ul> 203 <ul>
204 <li> 204 <li>
205 <?php 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 else { 211 else {
210 echo '<span itemprop="price">'.number_format($item['price2'], 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; 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,9 +33,12 @@
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 - <?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 else { 43 else {
41 echo '<span>'.$i['price'].'</span> грн'; 44 echo '<span>'.$i['price'].'</span> грн';