Commit 7445c339c8d68d1e1f0f5b58a7b0858de1a5dd7f

Authored by Volodymyr
1 parent ec957aa4

product modal js

frontend/controllers/SiteController.php
... ... @@ -4,6 +4,7 @@
4 4  
5 5 use artbox\core\models\Page;
6 6 use common\models\Feedback;
  7 + use common\models\Product;
7 8 use common\models\Settings;
8 9 use common\models\Slider;
9 10 use common\models\Tile;
... ... @@ -101,7 +102,8 @@
101 102 ->orderBy('id')
102 103 ->limit(4)
103 104 ->all();
104   -
  105 + $productsCompany = Product::find()->where(['!=','type',Product::TYPE_PRIVATE])->all();
  106 + $productsPrivate = Product::find()->where(['!=','type',Product::TYPE_COMPANY])->all();
105 107 return $this->render(
106 108 'index',
107 109 [
... ... @@ -110,6 +112,8 @@
110 112 'forCompanies'=>$forCompanies,
111 113 'forPrivate'=>$forPrivate,
112 114 'tiles'=>$tiles,
  115 + 'productsCompany'=>$productsCompany,
  116 + 'productsPrivate'=>$productsPrivate,
113 117 ]
114 118 );
115 119 }
... ...
frontend/views/site/index.php
... ... @@ -672,7 +672,7 @@ $coordinates['lon'] = empty($settings->lon) ? 0 : $settings->lon;
672 672 width="100%" height="380" style="border:0;" allowfullscreen="" loading="lazy"></iframe>
673 673 </section>
674 674 </div>
675   -<a href="#" class="animation-hover" data-title="hhh" data-toggle="modal" data-target="#cardProduct">
  675 +<a href="#" class="animation-hover" data-boo="fffff" data-title="hhh" data-toggle="modal" data-target="#cardProduct">
676 676 Получить консультацию </a>
677 677 <!-- Modal -->
678 678 <div class="modal fade" id="cardProduct" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
... ...
frontend/web/js/product.js
... ... @@ -4,6 +4,10 @@ var counter = document.querySelector(&#39;#cardProduct .product-counter__input&#39;);
4 4 if (phoneInput) {
5 5 phoneInput.addEventListener('input', phoneHandleInput);
6 6 }
  7 +$('#cardProduct').on('show.bs.modal', function (e) {
  8 + var button = $(e.relatedTarget)
  9 + console.log(button.data('boo'));
  10 +})
7 11  
8 12 if (counter) {
9 13 counterFunc(counter);
... ...