Commit 446925e6da5d31b98b3115adc0209f54ac338e53
1 parent
98d9d249
common
Showing
1 changed file
with
8 additions
and
8 deletions
Show diff stats
src/lib/common.php
... | ... | @@ -762,9 +762,9 @@ namespace |
762 | 762 | */ |
763 | 763 | public function getGroups1( $lang_id, $groups) |
764 | 764 | { |
765 | - $groups_ = []; | |
766 | - $compare = $this->getDi()->get('session')->get('compare', []); | |
767 | - $users_group_id = $this->getDi()->get('session')->get('users_group_id'); | |
765 | + $groups_ = []; | |
766 | + $compare = $this->getDi()->get('session')->get('compare', []); | |
767 | + $users_group_id = $this->getDi()->get('session')->get('users_group_id'); | |
768 | 768 | |
769 | 769 | if( !empty( $groups ) ) |
770 | 770 | { |
... | ... | @@ -779,8 +779,6 @@ namespace |
779 | 779 | $items_[$i['id']] = $i; |
780 | 780 | } |
781 | 781 | |
782 | - | |
783 | - | |
784 | 782 | foreach( $groups as &$g ) |
785 | 783 | { |
786 | 784 | $g['items'] = $this->getDi()->get('models')->getItems()->getSizesByGroupId($lang_id, $g['group_id']); |
... | ... | @@ -788,18 +786,20 @@ namespace |
788 | 786 | for($i = 0; $i < count($g['items']); $i++) { |
789 | 787 | $g['items'][$i]['prices'] = $this->getPricesArray($g['items'][$i]); |
790 | 788 | } |
789 | + | |
791 | 790 | $g['price'] = !empty( $items_[$g['id']]['price2'] ) ? $items_[$g['id']]['price2'] : 0; |
792 | - //5% for vip users | |
793 | - if (isset($users_group_id) && $users_group_id == 38) | |
794 | - $g['price'] = $g['price']*0.95; | |
795 | 791 | $g['title'] = !empty( $items_[$g['id']]['title'] ) ? $items_[$g['id']]['title'] : ''; |
796 | 792 | $g['description'] = !empty( $items_[$g['id']]['description'] ) ? $this->shortenString($items_[$g['id']]['description'], 200) : ''; |
797 | 793 | $g['content_description'] = !empty( $items_[$g['id']]['content_description'] ) ? $items_[$g['id']]['content_description'] : ''; |
798 | 794 | $g['cover'] = !empty( $g['cover'] ) ? $this->getDi()->get('storage')->getPhotoUrl( $g['cover'], 'avatar', '200x' ) : '/images/packet.jpg'; |
799 | 795 | $g['alias'] = $this->getDi()->get('url')->get([ 'for' => 'item', 'type' => $g['type_alias'], 'subtype' => $g['subtype_alias'], 'group_alias' => $g['alias'], 'item_id' => $g['id'] ]); |
796 | + | |
800 | 797 | if(isset($g['type_id']) && isset($g['catalog'])) |
801 | 798 | $g['checked'] = !empty($compare[$g['type_id']][$g['catalog']]) && in_array($g['id'], $compare[$g['type_id']][$g['catalog']]) ? 1 : 0; |
802 | 799 | |
800 | + //5% for vip users | |
801 | + if (isset($users_group_id) && $users_group_id == 38) | |
802 | + $g['price'] = $g['price']*0.95; | |
803 | 803 | |
804 | 804 | if( !empty( $g['options'] ) ) |
805 | 805 | { | ... | ... |