Commit e2f8e15e0f6a4eac92b08be7a7f1f227a09100fb

Authored by Alex Savenko
1 parent 1b674abf

search discount

Showing 1 changed file with 1 additions and 22 deletions   Show diff stats
src/app/frontend/controllers/PageController.php
... ... @@ -1390,7 +1390,7 @@
1390 1390 {
1391 1391 $items_ids = $this->common->array_column( $items_, 'item_id' );
1392 1392 $items = $this->models->getItems()->getItemsByIds( $this->lang_id, $items_ids );
1393   -
  1393 +
1394 1394 foreach( $items as &$i )
1395 1395 {
1396 1396 $i['cover'] = !empty( $i['group_cover'] ) ? $this->storage->getPhotoUrl( $i['group_cover'], 'avatar', '200x' ) : '/images/packet.jpg';
... ... @@ -1408,25 +1408,6 @@
1408 1408 unset($i['options']);
1409 1409 }
1410 1410 }
1411   -
1412   - //discount
1413   - $discount = $this->models->getDiscount()->getActiveData();
1414   - if (!empty($discount)) {
1415   - $discount = $discount[0];
1416   - $discount['group_ids'] = str_replace('{', '', $discount['group_ids']);
1417   - $discount['group_ids'] = str_replace('}', '', $discount['group_ids']);
1418   - $discount['group_ids'] = explode(',', $discount['group_ids']);
1419   - if ($discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item_id, $discount['group_ids'])) {
1420   - $discount = $discount['discount'];
1421   - }
1422   - else {
1423   - $discount = 0;
1424   - }
1425   - } else {
1426   - $discount = 0;
1427   - }
1428   - //vip
1429   - $users_group_id = $this->session->get('users_group_id');
1430 1411  
1431 1412 if( $total_items['0']['total'] > \config::get( 'limits/items') )
1432 1413 {
... ... @@ -1462,8 +1443,6 @@
1462 1443 'meta_link_next' => $meta_link_next[1],
1463 1444 'meta_link_prev' => $meta_link_prev[1],
1464 1445 'paginate' => !empty($paginate['output']) ? $paginate['output'] : '' ,
1465   - 'discount' => $discount,
1466   - 'users_group_id' => $users_group_id
1467 1446 ]);
1468 1447 }
1469 1448  
... ...