Commit bb4cb82d2b1f67c225355452bbd04247632b1545

Authored by Alex Savenko
2 parents ebbc3639 c83e2f9e

Merge branch 'discount' of gitlab.artweb.com.ua:Alex/semena

src/app/frontend/controllers/PageController.php
... ... @@ -434,7 +434,15 @@
434 434 '1' => (isset( $seo['description'] ) && !empty( $seo['description'] ) ? $seo['description'] : 'Замовити '.$catalog['catalog']['title'].' у Києві за найкращою ціною. Якість товара підтверджена професіоналами.').(isset( $page ) && !empty( $page ) && $page != '1' ? ' страница '.$page : ''),
435 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 446 if($subtype==='semena_gazonnykh_trav_1c_21')
439 447 $this->view->setMainView('landing');
440 448 elseif($subtype==='nasinnja_gazonnikh_trav_1c1')
... ... @@ -467,7 +475,8 @@
467 475 'subtype_alias' => $subtype_alias,
468 476 'catalog_sales' => $catalog_sales,
469 477 'css' => $cssSale,
470   - 'js' => $jsSale
  478 + 'js' => $jsSale,
  479 + 'discount' => $discount
471 480 ]);
472 481 }
473 482 else
... ...
src/app/frontend/views/page/subtype.php
... ... @@ -197,7 +197,7 @@
197 197 $minPrice = 0;
198 198 ?>
199 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 201 <?php
202 202 if ($i['price'] > $maxPrice) {
203 203 $maxPrice = $i['price'];
... ...