Commit bb4cb82d2b1f67c225355452bbd04247632b1545
Merge branch 'discount' of gitlab.artweb.com.ua:Alex/semena
Showing
2 changed files
with
12 additions
and
3 deletions
Show diff stats
src/app/frontend/controllers/PageController.php
@@ -434,7 +434,15 @@ | @@ -434,7 +434,15 @@ | ||
434 | '1' => (isset( $seo['description'] ) && !empty( $seo['description'] ) ? $seo['description'] : 'Замовити '.$catalog['catalog']['title'].' у Києві за найкращою ціною. Якість товара підтверджена професіоналами.').(isset( $page ) && !empty( $page ) && $page != '1' ? ' страница '.$page : ''), | 434 | '1' => (isset( $seo['description'] ) && !empty( $seo['description'] ) ? $seo['description'] : 'Замовити '.$catalog['catalog']['title'].' у Києві за найкращою ціною. Якість товара підтверджена професіоналами.').(isset( $page ) && !empty( $page ) && $page != '1' ? ' страница '.$page : ''), |
435 | '2' => (isset( $seo['description'] ) && !empty( $seo['description'] ) ? $seo['description'] : 'Заказать '.$catalog['catalog']['title'].' в Киеве по лучшей цене. Качество товара подтверждена профессионалами.').(isset( $page ) && !empty( $page ) && $page != '1' ? ' страница '.$page : '') | 435 | '2' => (isset( $seo['description'] ) && !empty( $seo['description'] ) ? $seo['description'] : 'Заказать '.$catalog['catalog']['title'].' в Киеве по лучшей цене. Качество товара подтверждена профессионалами.').(isset( $page ) && !empty( $page ) && $page != '1' ? ' страница '.$page : '') |
436 | ]; | 436 | ]; |
437 | - | 437 | + |
438 | + $discount = $this->models->getDiscount()->getActiveData(); | ||
439 | + if (!empty($discount)) { | ||
440 | + $discount = $discount[0]; | ||
441 | + $discount['group_ids'] = str_replace('{', '', $discount['group_ids']); | ||
442 | + $discount['group_ids'] = str_replace('}', '', $discount['group_ids']); | ||
443 | + $discount['group_ids'] = explode(',', $discount['group_ids']); | ||
444 | + } | ||
445 | + | ||
438 | if($subtype==='semena_gazonnykh_trav_1c_21') | 446 | if($subtype==='semena_gazonnykh_trav_1c_21') |
439 | $this->view->setMainView('landing'); | 447 | $this->view->setMainView('landing'); |
440 | elseif($subtype==='nasinnja_gazonnikh_trav_1c1') | 448 | elseif($subtype==='nasinnja_gazonnikh_trav_1c1') |
@@ -467,7 +475,8 @@ | @@ -467,7 +475,8 @@ | ||
467 | 'subtype_alias' => $subtype_alias, | 475 | 'subtype_alias' => $subtype_alias, |
468 | 'catalog_sales' => $catalog_sales, | 476 | 'catalog_sales' => $catalog_sales, |
469 | 'css' => $cssSale, | 477 | 'css' => $cssSale, |
470 | - 'js' => $jsSale | 478 | + 'js' => $jsSale, |
479 | + 'discount' => $discount | ||
471 | ]); | 480 | ]); |
472 | } | 481 | } |
473 | else | 482 | else |
src/app/frontend/views/page/subtype.php
@@ -197,7 +197,7 @@ | @@ -197,7 +197,7 @@ | ||
197 | $minPrice = 0; | 197 | $minPrice = 0; |
198 | ?> | 198 | ?> |
199 | <?php foreach ($groups as $k => $i): ?> | 199 | <?php foreach ($groups as $k => $i): ?> |
200 | - <?php $this->partial('partial/item_group', ['k' => $k, 'i' => $i, 'limit' => 3]) ?> | 200 | + <?php $this->partial('partial/item_group', ['k' => $k, 'i' => $i, 'limit' => 3, 'discount' => $discount]) ?> |
201 | <?php | 201 | <?php |
202 | if ($i['price'] > $maxPrice) { | 202 | if ($i['price'] > $maxPrice) { |
203 | $maxPrice = $i['price']; | 203 | $maxPrice = $i['price']; |