diff --git a/src/lib/common.php b/src/lib/common.php index bf2365b..3f60584 100644 --- a/src/lib/common.php +++ b/src/lib/common.php @@ -764,6 +764,7 @@ namespace { $groups_ = []; $compare = $this->getDi()->get('session')->get('compare', []); + $users_group_id = $this->session->get('users_group_id'); if( !empty( $groups ) ) { @@ -788,13 +789,16 @@ namespace $g['items'][$i]['prices'] = $this->getPricesArray($g['items'][$i]); } $g['price'] = !empty( $items_[$g['id']]['price2'] ) ? $items_[$g['id']]['price2'] : 0; + //5% for vip users + if (isset($users_group_id) && $users_group_id == 38) + $g['price'] = $g['price']*0.95; $g['title'] = !empty( $items_[$g['id']]['title'] ) ? $items_[$g['id']]['title'] : ''; $g['description'] = !empty( $items_[$g['id']]['description'] ) ? $this->shortenString($items_[$g['id']]['description'], 200) : ''; $g['content_description'] = !empty( $items_[$g['id']]['content_description'] ) ? $items_[$g['id']]['content_description'] : ''; $g['cover'] = !empty( $g['cover'] ) ? $this->getDi()->get('storage')->getPhotoUrl( $g['cover'], 'avatar', '200x' ) : '/images/packet.jpg'; $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'] ]); if(isset($g['type_id']) && isset($g['catalog'])) - $g['checked'] = !empty($compare[$g['type_id']][$g['catalog']]) && in_array($g['id'], $compare[$g['type_id']][$g['catalog']]) ? 1 : 0; + $g['checked'] = !empty($compare[$g['type_id']][$g['catalog']]) && in_array($g['id'], $compare[$g['type_id']][$g['catalog']]) ? 1 : 0; if( !empty( $g['options'] ) ) -- libgit2 0.21.4