Commit 688bf3773e9c6f756ec742361e2ec9d5aaa380f9
1 parent
5ff30e4d
common
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
src/lib/common.php
@@ -764,6 +764,7 @@ namespace | @@ -764,6 +764,7 @@ namespace | ||
764 | { | 764 | { |
765 | $groups_ = []; | 765 | $groups_ = []; |
766 | $compare = $this->getDi()->get('session')->get('compare', []); | 766 | $compare = $this->getDi()->get('session')->get('compare', []); |
767 | + $users_group_id = $this->session->get('users_group_id'); | ||
767 | 768 | ||
768 | if( !empty( $groups ) ) | 769 | if( !empty( $groups ) ) |
769 | { | 770 | { |
@@ -788,13 +789,16 @@ namespace | @@ -788,13 +789,16 @@ namespace | ||
788 | $g['items'][$i]['prices'] = $this->getPricesArray($g['items'][$i]); | 789 | $g['items'][$i]['prices'] = $this->getPricesArray($g['items'][$i]); |
789 | } | 790 | } |
790 | $g['price'] = !empty( $items_[$g['id']]['price2'] ) ? $items_[$g['id']]['price2'] : 0; | 791 | $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; | ||
791 | $g['title'] = !empty( $items_[$g['id']]['title'] ) ? $items_[$g['id']]['title'] : ''; | 795 | $g['title'] = !empty( $items_[$g['id']]['title'] ) ? $items_[$g['id']]['title'] : ''; |
792 | $g['description'] = !empty( $items_[$g['id']]['description'] ) ? $this->shortenString($items_[$g['id']]['description'], 200) : ''; | 796 | $g['description'] = !empty( $items_[$g['id']]['description'] ) ? $this->shortenString($items_[$g['id']]['description'], 200) : ''; |
793 | $g['content_description'] = !empty( $items_[$g['id']]['content_description'] ) ? $items_[$g['id']]['content_description'] : ''; | 797 | $g['content_description'] = !empty( $items_[$g['id']]['content_description'] ) ? $items_[$g['id']]['content_description'] : ''; |
794 | $g['cover'] = !empty( $g['cover'] ) ? $this->getDi()->get('storage')->getPhotoUrl( $g['cover'], 'avatar', '200x' ) : '/images/packet.jpg'; | 798 | $g['cover'] = !empty( $g['cover'] ) ? $this->getDi()->get('storage')->getPhotoUrl( $g['cover'], 'avatar', '200x' ) : '/images/packet.jpg'; |
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'] ]); | 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'] ]); |
796 | if(isset($g['type_id']) && isset($g['catalog'])) | 800 | if(isset($g['type_id']) && isset($g['catalog'])) |
797 | - $g['checked'] = !empty($compare[$g['type_id']][$g['catalog']]) && in_array($g['id'], $compare[$g['type_id']][$g['catalog']]) ? 1 : 0; | 801 | + $g['checked'] = !empty($compare[$g['type_id']][$g['catalog']]) && in_array($g['id'], $compare[$g['type_id']][$g['catalog']]) ? 1 : 0; |
798 | 802 | ||
799 | 803 | ||
800 | if( !empty( $g['options'] ) ) | 804 | if( !empty( $g['options'] ) ) |