Commit ab5a7cfe51ea67c99b92658fb46a7e8de2bc516a
1 parent
c8c20603
vip prices tests
Showing
2 changed files
with
26 additions
and
7 deletions
Show diff stats
src/app/frontend/controllers/PageController.php
@@ -438,6 +438,7 @@ | @@ -438,6 +438,7 @@ | ||
438 | '2' => (isset( $seo['description'] ) && !empty( $seo['description'] ) ? $seo['description'] : 'Заказать '.$catalog['catalog']['title'].' в Киеве по лучшей цене. Качество товара подтверждена профессионалами.').(isset( $page ) && !empty( $page ) && $page != '1' ? ' страница '.$page : '') | 438 | '2' => (isset( $seo['description'] ) && !empty( $seo['description'] ) ? $seo['description'] : 'Заказать '.$catalog['catalog']['title'].' в Киеве по лучшей цене. Качество товара подтверждена профессионалами.').(isset( $page ) && !empty( $page ) && $page != '1' ? ' страница '.$page : '') |
439 | ]; | 439 | ]; |
440 | 440 | ||
441 | + //discount | ||
441 | $discount = $this->models->getDiscount()->getActiveData(); | 442 | $discount = $this->models->getDiscount()->getActiveData(); |
442 | if (!empty($discount)) { | 443 | if (!empty($discount)) { |
443 | $discount = $discount[0]; | 444 | $discount = $discount[0]; |
@@ -445,6 +446,8 @@ | @@ -445,6 +446,8 @@ | ||
445 | $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); | 446 | $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); |
446 | $discount['group_ids'] = explode(',', $discount['group_ids']); | 447 | $discount['group_ids'] = explode(',', $discount['group_ids']); |
447 | } | 448 | } |
449 | + //vip | ||
450 | + $users_group_id = $this->session->get('users_group_id'); | ||
448 | 451 | ||
449 | if($subtype==='semena_gazonnykh_trav_1c_21') | 452 | if($subtype==='semena_gazonnykh_trav_1c_21') |
450 | $this->view->setMainView('landing'); | 453 | $this->view->setMainView('landing'); |
@@ -479,7 +482,8 @@ | @@ -479,7 +482,8 @@ | ||
479 | 'catalog_sales' => $catalog_sales, | 482 | 'catalog_sales' => $catalog_sales, |
480 | 'css' => $cssSale, | 483 | 'css' => $cssSale, |
481 | 'js' => $jsSale, | 484 | 'js' => $jsSale, |
482 | - 'discount' => $discount | 485 | + 'discount' => $discount, |
486 | + 'users_group_id' => $users_group_id | ||
483 | ]); | 487 | ]); |
484 | } | 488 | } |
485 | else | 489 | else |
@@ -708,6 +712,7 @@ | @@ -708,6 +712,7 @@ | ||
708 | } | 712 | } |
709 | } | 713 | } |
710 | 714 | ||
715 | + //discount | ||
711 | $discount = $this->models->getDiscount()->getActiveData(); | 716 | $discount = $this->models->getDiscount()->getActiveData(); |
712 | if (!empty($discount)) { | 717 | if (!empty($discount)) { |
713 | $discount = $discount[0]; | 718 | $discount = $discount[0]; |
@@ -715,6 +720,8 @@ | @@ -715,6 +720,8 @@ | ||
715 | $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); | 720 | $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); |
716 | $discount['group_ids'] = explode(',', $discount['group_ids']); | 721 | $discount['group_ids'] = explode(',', $discount['group_ids']); |
717 | } | 722 | } |
723 | + //vip | ||
724 | + $users_group_id = $this->session->get('users_group_id'); | ||
718 | 725 | ||
719 | $cssSale = [ | 726 | $cssSale = [ |
720 | 'https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic', | 727 | 'https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic', |
@@ -758,7 +765,8 @@ | @@ -758,7 +765,8 @@ | ||
758 | 'catalog_sales' => $catalog_sales, | 765 | 'catalog_sales' => $catalog_sales, |
759 | 'css' => $cssSale, | 766 | 'css' => $cssSale, |
760 | 'js' => $jsSale, | 767 | 'js' => $jsSale, |
761 | - 'discount' => $discount | 768 | + 'discount' => $discount, |
769 | + 'users_group_id' => $users_group_id | ||
762 | ]); | 770 | ]); |
763 | } | 771 | } |
764 | 772 | ||
@@ -924,6 +932,7 @@ | @@ -924,6 +932,7 @@ | ||
924 | '2' => isset($seo['description']) && !empty($seo['description']) ? $seo['description'] : 'Профессионалы рекомендуют ' . $catalog_name . ' ' . $item['0']['title'] . ' в интернет магазине семян Semena.in.ua.' | 932 | '2' => isset($seo['description']) && !empty($seo['description']) ? $seo['description'] : 'Профессионалы рекомендуют ' . $catalog_name . ' ' . $item['0']['title'] . ' в интернет магазине семян Semena.in.ua.' |
925 | ]; | 933 | ]; |
926 | 934 | ||
935 | + //discount | ||
927 | $discount = $this->models->getDiscount()->getActiveData(); | 936 | $discount = $this->models->getDiscount()->getActiveData(); |
928 | if (!empty($discount)) { | 937 | if (!empty($discount)) { |
929 | $discount = $discount[0]; | 938 | $discount = $discount[0]; |
@@ -931,6 +940,8 @@ | @@ -931,6 +940,8 @@ | ||
931 | $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); | 940 | $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); |
932 | $discount['group_ids'] = explode(',', $discount['group_ids']); | 941 | $discount['group_ids'] = explode(',', $discount['group_ids']); |
933 | } | 942 | } |
943 | + //vip | ||
944 | + $users_group_id = $this->session->get('users_group_id'); | ||
934 | 945 | ||
935 | $this->view->setVars([ | 946 | $this->view->setVars([ |
936 | 'change_lang_url' => $lang_url, | 947 | 'change_lang_url' => $lang_url, |
@@ -953,7 +964,8 @@ | @@ -953,7 +964,8 @@ | ||
953 | 'catalog_id' => $catalog_id, | 964 | 'catalog_id' => $catalog_id, |
954 | 'type_alias' => $type_alias, | 965 | 'type_alias' => $type_alias, |
955 | 'subtype_alias' => $subtype_alias, | 966 | 'subtype_alias' => $subtype_alias, |
956 | - 'discount' => $discount | 967 | + 'discount' => $discount, |
968 | + 'users_group_id' => $users_group_id | ||
957 | ]); | 969 | ]); |
958 | } | 970 | } |
959 | else | 971 | else |
@@ -1110,6 +1122,7 @@ | @@ -1110,6 +1122,7 @@ | ||
1110 | ]); | 1122 | ]); |
1111 | } | 1123 | } |
1112 | 1124 | ||
1125 | + //discount | ||
1113 | $discount = $this->models->getDiscount()->getActiveData(); | 1126 | $discount = $this->models->getDiscount()->getActiveData(); |
1114 | if (!empty($discount)) { | 1127 | if (!empty($discount)) { |
1115 | $discount = $discount[0]; | 1128 | $discount = $discount[0]; |
@@ -1125,11 +1138,14 @@ | @@ -1125,11 +1138,14 @@ | ||
1125 | } else { | 1138 | } else { |
1126 | $discount = 0; | 1139 | $discount = 0; |
1127 | } | 1140 | } |
1141 | + //vip | ||
1142 | + $users_group_id = $this->session->get('users_group_id'); | ||
1128 | 1143 | ||
1129 | $this->view->pick('page/changeWithSize'); | 1144 | $this->view->pick('page/changeWithSize'); |
1130 | $this->view->setVars([ | 1145 | $this->view->setVars([ |
1131 | - 'item' => $item['0'], | ||
1132 | - 'discount' => $discount | 1146 | + 'item' => $item['0'], |
1147 | + 'discount' => $discount, | ||
1148 | + 'users_group_id' => $users_group_id | ||
1133 | ]); | 1149 | ]); |
1134 | $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); | 1150 | $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); |
1135 | } | 1151 | } |
src/app/frontend/views/page/item.php
@@ -203,20 +203,23 @@ | @@ -203,20 +203,23 @@ | ||
203 | <ul> | 203 | <ul> |
204 | <li> | 204 | <li> |
205 | <?php | 205 | <?php |
206 | + //vip | ||
207 | + if (isset($users_group_id) && $users_group_id == 37) { | ||
208 | + $item['price2'] = round($item['price2']*0.95, 1); | ||
209 | + } | ||
206 | // скидка | 210 | // скидка |
207 | if (!empty($discount)) { | 211 | if (!empty($discount)) { |
208 | if (isset($discount) && $discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item['id'], $discount['group_ids'])) { | 212 | if (isset($discount) && $discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item['id'], $discount['group_ids'])) { |
209 | echo '<span itemprop="price">'.number_format($item['price2']*(1-$discount['discount']/100), 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; | 213 | echo '<span itemprop="price">'.number_format($item['price2']*(1-$discount['discount']/100), 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; |
210 | } | 214 | } |
211 | else { | 215 | else { |
212 | - //echo '<span itemprop="price">'.number_format($item['price2'], 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; | 216 | + echo '<span itemprop="price">'.number_format($item['price2'], 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; |
213 | } | 217 | } |
214 | } | 218 | } |
215 | else { | 219 | else { |
216 | echo '<span itemprop="price">'.number_format($item['price2'], 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; | 220 | echo '<span itemprop="price">'.number_format($item['price2'], 2, '.', ' ').'</span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>'; |
217 | } | 221 | } |
218 | ?> | 222 | ?> |
219 | - <!--<span itemprop="price"><?//= number_format($item['price2'], 2, '.', ' '); ?></span> грн<span style="display:none;" itemprop="priceCurrency">UAH</span>--> | ||
220 | <div style="display: none" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> | 223 | <div style="display: none" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> |
221 | <span itemprop="ratingValue">5</span> | 224 | <span itemprop="ratingValue">5</span> |
222 | <span itemprop="reviewCount">31</span> | 225 | <span itemprop="reviewCount">31</span> |