From 0580270b86d0b2594ce7fffa1cb521f7551a6549 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 29 Dec 2016 18:05:53 +0200 Subject: [PATCH] common --- src/app/frontend/controllers/PageController.php | 9 +++------ src/app/frontend/views/partial/item_group.php | 30 +++++++++++++----------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/src/app/frontend/controllers/PageController.php b/src/app/frontend/controllers/PageController.php index b033172..57aa376 100644 --- a/src/app/frontend/controllers/PageController.php +++ b/src/app/frontend/controllers/PageController.php @@ -144,8 +144,6 @@ $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); $discount['group_ids'] = explode(',', $discount['group_ids']); } - //vip - $users_group_id = $this->session->get('users_group_id'); $css = [ '/landing_sales/style.css', @@ -183,8 +181,7 @@ 'meta_description' => $meta_description[$this->lang_id], 'slider' => $slider, 'active_sales' => $active_sales, - 'discount' => $discount, - 'users_group_id' => $users_group_id + 'discount' => $discount ]); } @@ -1362,8 +1359,8 @@ $p['subtype_alias'] = $p['explode']['2']; unset( $p['explode'] ); } - - + + $groups_ = $this->common->getGroups1( $this->lang_id, $groups ); } diff --git a/src/app/frontend/views/partial/item_group.php b/src/app/frontend/views/partial/item_group.php index a2a7fd4..18f1ca3 100644 --- a/src/app/frontend/views/partial/item_group.php +++ b/src/app/frontend/views/partial/item_group.php @@ -34,23 +34,19 @@
_("price_from") ?> 0 && $discount['discount'] <= 100 && in_array($i['id'], $discount['group_ids'])) { -// echo ''.$i['price'].' грн
'; -// echo ''.round($i['price']*(1-$discount['discount']/100), 1).' грн'; -// } -// else { -// echo ''.$i['price'].' грн'; -// } -// } -// else { -// echo ''.$i['price'].' грн'; -// } + // скидка + if (!empty($discount)) { + if ($discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($i['id'], $discount['group_ids'])) { + echo ''.$i['price'].' грн
'; + echo ''.round($i['price']*(1-$discount['discount']/100), 1).' грн'; + } + else { + echo ''.$i['price'].' грн'; + } + } + else { + echo ''.$i['price'].' грн'; + } ?> грн
-- libgit2 0.21.4