Commit 3a153125f28d34064fa320acd989b8a0ce638e96
1 parent
1e0a25aa
test
Showing
3 changed files
with
11 additions
and
2 deletions
Show diff stats
src/app/frontend/controllers/PageController.php
@@ -1352,6 +1352,16 @@ | @@ -1352,6 +1352,16 @@ | ||
1352 | 1352 | ||
1353 | 1353 | ||
1354 | $groups_ = $this->common->getGroups1( $this->lang_id, $groups ); | 1354 | $groups_ = $this->common->getGroups1( $this->lang_id, $groups ); |
1355 | + | ||
1356 | + //discount | ||
1357 | + $discount = $this->models->getDiscount()->getActiveData(); | ||
1358 | + $discount = $this->models->getDiscount()->explodeGroupIds($discount); | ||
1359 | + $discount = $discount[0]; | ||
1360 | + foreach ($groups_ as &$item) { | ||
1361 | + if ($discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item['id'], $discount['group_ids'])) { | ||
1362 | + $item['discounted_price'] = round($item['price']*(1-$discount['discount']/100), 1); | ||
1363 | + } | ||
1364 | + } | ||
1355 | } | 1365 | } |
1356 | 1366 | ||
1357 | die( json_encode( $groups_ ) ); | 1367 | die( json_encode( $groups_ ) ); |
src/app/frontend/views/partial/item_group.php
@@ -69,7 +69,7 @@ | @@ -69,7 +69,7 @@ | ||
69 | 69 | ||
70 | <div class="one_item_compare"> | 70 | <div class="one_item_compare"> |
71 | <input type="checkbox" id="items_compare_item_<?= $i['id'] ?>" value="<?= $i['type_id'].'-'.$i['catalog'].'-'.$i['id'] ?>" <?= ( !empty($i['checked']) ? 'checked' : '' ) ?> /> | 71 | <input type="checkbox" id="items_compare_item_<?= $i['id'] ?>" value="<?= $i['type_id'].'-'.$i['catalog'].'-'.$i['id'] ?>" <?= ( !empty($i['checked']) ? 'checked' : '' ) ?> /> |
72 | - <label for="items_compare_item_<?= $i['id'] ?>"><span></span><?= $t->_("compared_to") ?>!><!</label> | 72 | + <label for="items_compare_item_<?= $i['id'] ?>"><span></span><?= $t->_("compared_to") ?></label> |
73 | </div> | 73 | </div> |
74 | 74 | ||
75 | </div> | 75 | </div> |
src/lib/common.php
@@ -779,7 +779,6 @@ namespace | @@ -779,7 +779,6 @@ namespace | ||
779 | } | 779 | } |
780 | 780 | ||
781 | 781 | ||
782 | - | ||
783 | foreach( $groups as &$g ) | 782 | foreach( $groups as &$g ) |
784 | { | 783 | { |
785 | $g['items'] = $this->getDi()->get('models')->getItems()->getSizesByGroupId($lang_id, $g['group_id']); | 784 | $g['items'] = $this->getDi()->get('models')->getItems()->getSizesByGroupId($lang_id, $g['group_id']); |