Blame view

frontend/views/catalog/_product_item.php 7.28 KB
8072159c   Alex Savenko   create proj
1
2
3
4
5
6
7
  <?php

      /**

       * @var $model  common\modules\product\models\Product

       */

  use yii\helpers\Html;

  use yii\helpers\Url;

  ?>

bab0e82d   Alex Savenko   микроразметка кат...
8
9
  <div class="catalog_item">

  <!--<div class="catalog_item" itemscope itemtype="http://schema.org/Product">-->

8072159c   Alex Savenko   create proj
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
      <div class="wrapper">

          <div class="item_container" >

              <input class="prodInfo" type="hidden" value="[]">

              <div class="title">

                  <?= Html::a( $model->name, Url::to(['catalog/product', 'product' => $model->alias]), ['class'=>'btn-product-details','data-pjax'=>0, 'itemprop' => 'name'] )?>

              </div>

              <div class="img">

                  <a data-pjax=0 class="btn-product-details"

  

  

                     href="<?= Url::to([

                      'catalog/product',

                      'product' => $model->alias

                  ]) ?>">

                      <div class="banners_sale">

  

                              <?php

                              foreach($model->events as $event){

                                  if($event->banner){

                                      echo \common\components\artboximage\ArtboxImageHelper::getImage($event->getImageUrl('banner'), 'banner_list',[

                                          'class' => 'banner-in-list'

                                      ]);

                                  }

                              }

  

                              ?>

  

                      </div>

                      <?= \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list', [

                          'alt'   => $model->category->name . ' ' . $model->name,

                          'title' => $model->category->name . ' ' . $model->name,

                          'class' => 'selected',

                          'itemprop' => 'image'

                      ]) ?>

                  </a>

                  <div class="info_icons">

                      <?php if($model->variant->status != 1){?>

                          <a href="#" class="btn buy_button" data-toggle="modal" data-target="#buyForm" data-id="<?=$model->variant->product_variant_id; ?>" lang="145">Купить</a>

                      <?php }else { ?>

                          <a href="#"  style="background-color:dimgrey; background-image:linear-gradient(to bottom, #9d9fa0, #abafb2);cursor:default !important;color:#fff!important;box-shadow: none !important;border-top: 1px solid #256caf !important;border-bottom: 1px solid #256caf !important;" class="btn btn-large btn-default " data-id="<?=$model->variant->product_variant_id; ?>" lang="145">Снят с производства</a>

                      <?php } ?>

                      <ul class="ul wishlike_block hidden">

                          <li class="compare  hidden">

                              <a onclick="add2compare(); return false;" class="compare compare_text_link_3631483" href="#">К сравнению</a>

                              <span class="icon"></span>

                          </li>

                          <li class="like hidden">

                              <a class="like like_text_link_3631483" href="#">В избранное</a><span class="icon"></span>

                          </li>

                      </ul>

                  </div>

              </div>

              <div class="price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">

  

                <?php if($model->variant->price_old){?>

                  <div class="dlexfduinxipi old_price-wr">

                      <span class="main">

                          <s><?= $model->variant->price_old  ?><span class="currency">грн</span></s>

                      </span>

                  </div>

                <?php }?>

                  <div class="dlexfduinxipi">

                      Цена:

                      <span class="main">

                          <span itemprop="price"><?= $model->variant->price ?></span>

                          <meta itemprop="priceCurrency" content = "UAH" />

                          <span class="currency">грн</span>

                      </span>

                  </div>

              </div>

              <div class="additional_info params">

                  <div class="block_title">Особенности

                      <span style="float: right;font-weight: normal;color: #390;font-size: 13px;">

                           <?php if($model->variant->status == 1){?>

                               снят с производства

                           <?php } elseif($model->variant->stock > 0) {?>

                               в наличии

                           <?php } else {?>

                               под заказ

                           <?php } ?>

                      </span>

                  </div>

                  <div class="descr">

                      <div class="info">

                          <ul class="sv">

  <!--                            <li class="available">-->

  <!--                                --><?php //if($model->variant->status == 1){?>

  <!--                                    снят с производства-->

  <!--                                --><?php //} elseif($model->variant->stock > 0) {?>

  <!--                                    в наличии-->

  <!--                                --><?php //} else {?>

  <!--                                    под заказ-->

  <!--                                --><?php //} ?>

  <!--                            </li>-->

                              <li><span>Бренд:</span> <?= !empty($model->brand) ? $model->brand->name : '' ?></li>

  

                              <?php foreach($model->getActiveProperties($category->category_id) as $group): ?>

                                  <li><span><?= $group->name ?> <?php foreach($group->_options as $option) : ?>&nbsp;</span><?= $option->ValueRenderHTML ?><?php endforeach ?></li>

                              <?php endforeach; ?>

  

  

                          </ul>

                      </div>

                      <div class="clearfix"></div>

                  </div>

                  <div class="price" style="display: none;">

                      <div class="dlexfduinxipi">

                          Цена:

                          <span class="main">

                              <?php

  

                              echo '<div class="cost-block" itemprop="offers" itemscope itemtype="http://schema.org/Offer">';

  

                              // есть скидка

                              echo '<p  class="cost">';

                              if($model->variant->price_old != 0 && $model->variant->price_old != $model->variant->price) {

                                  echo '<strike><span id=\'old_cost\' itemprop="price">' . $model->variant->price_old . '</span> грн.</strike>&nbsp;';

                                  echo $model->variant->price . ' <span>грн.</span></p>';

                              } else {

                                  echo '<span  itemprop="price">'.$model->variant->price . ' </span><span>грн.</span></p>';

                              }

                              echo '<meta itemprop="priceCurrency" content = "UAH">';

                              echo '</div>';

  

                              ?>

                          </span>

                      </div>

                  </div>

              </div>

              <div class="opacity_bg"></div>

          </div>

      </div>

  </div>