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,9 +762,9 @@ namespace | ||
762 | */ | 762 | */ |
763 | public function getGroups1( $lang_id, $groups) | 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 | if( !empty( $groups ) ) | 769 | if( !empty( $groups ) ) |
770 | { | 770 | { |
@@ -779,8 +779,6 @@ namespace | @@ -779,8 +779,6 @@ namespace | ||
779 | $items_[$i['id']] = $i; | 779 | $items_[$i['id']] = $i; |
780 | } | 780 | } |
781 | 781 | ||
782 | - | ||
783 | - | ||
784 | foreach( $groups as &$g ) | 782 | foreach( $groups as &$g ) |
785 | { | 783 | { |
786 | $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']); |
@@ -788,18 +786,20 @@ namespace | @@ -788,18 +786,20 @@ namespace | ||
788 | for($i = 0; $i < count($g['items']); $i++) { | 786 | for($i = 0; $i < count($g['items']); $i++) { |
789 | $g['items'][$i]['prices'] = $this->getPricesArray($g['items'][$i]); | 787 | $g['items'][$i]['prices'] = $this->getPricesArray($g['items'][$i]); |
790 | } | 788 | } |
789 | + | ||
791 | $g['price'] = !empty( $items_[$g['id']]['price2'] ) ? $items_[$g['id']]['price2'] : 0; | 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 | $g['title'] = !empty( $items_[$g['id']]['title'] ) ? $items_[$g['id']]['title'] : ''; | 791 | $g['title'] = !empty( $items_[$g['id']]['title'] ) ? $items_[$g['id']]['title'] : ''; |
796 | $g['description'] = !empty( $items_[$g['id']]['description'] ) ? $this->shortenString($items_[$g['id']]['description'], 200) : ''; | 792 | $g['description'] = !empty( $items_[$g['id']]['description'] ) ? $this->shortenString($items_[$g['id']]['description'], 200) : ''; |
797 | $g['content_description'] = !empty( $items_[$g['id']]['content_description'] ) ? $items_[$g['id']]['content_description'] : ''; | 793 | $g['content_description'] = !empty( $items_[$g['id']]['content_description'] ) ? $items_[$g['id']]['content_description'] : ''; |
798 | $g['cover'] = !empty( $g['cover'] ) ? $this->getDi()->get('storage')->getPhotoUrl( $g['cover'], 'avatar', '200x' ) : '/images/packet.jpg'; | 794 | $g['cover'] = !empty( $g['cover'] ) ? $this->getDi()->get('storage')->getPhotoUrl( $g['cover'], 'avatar', '200x' ) : '/images/packet.jpg'; |
799 | $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'] ]); | 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 | if(isset($g['type_id']) && isset($g['catalog'])) | 797 | if(isset($g['type_id']) && isset($g['catalog'])) |
801 | $g['checked'] = !empty($compare[$g['type_id']][$g['catalog']]) && in_array($g['id'], $compare[$g['type_id']][$g['catalog']]) ? 1 : 0; | 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 | if( !empty( $g['options'] ) ) | 804 | if( !empty( $g['options'] ) ) |
805 | { | 805 | { |