Blame view

frontend/views/search/product_item.php 4.72 KB
e4cea6a9   Administrator   rm node nodule
1
2
3
4
5
6
7
8
9
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
  <?php
      /** @var \common\modules\product\models\Product $product */
      use common\modules\comment\assets\CommentAsset;
      use yii\helpers\Html;
      use yii\helpers\Url;
      
      Yii::$app->getModule('artbox-comment');
      CommentAsset::register($this);
  ?>
  <li class="item">
      <div class="boxitem">
          <div class="pixbox">
              <a href="<?= Url::to([
                  'catalog/product',
                  'product' => $product,
                  '#'       => 'm' . $product->variant->product_variant_id,
              ]) ?>">
                  <?= \common\components\artboximage\ArtboxImageHelper::getImage($product->variant->imageUrl, 'list', [
                      'alt'   => $product->category->categoryName->value . ' ' . $product->fullname,
                      'title' => $product->category->categoryName->value . ' ' . $product->fullname,
                  ]) ?>
              </a>
          </div>
          <?php if(!empty( $product->is_top ) || !empty( $product->is_new ) || !empty( $product->akciya )) : ?>
              <ul class="product-special">
                  <?php if(!empty( $product->is_top )) : ?>
                      <li class="top">
                          <div>top</div>
                      </li>
                  <?php endif ?>
                  <?php if(!empty( $product->is_new )) : ?>
                      <li class="new">
                          <div>new</div>
                      </li>
                  <?php endif ?>
                  <?php if(!empty( $product->akciya )) : ?>
                      <li class="promo">
                          <div>Акция</div>
                      </li>
                  <?php endif ?>
              </ul>
          <?php endif ?>
          <div class="comment_display_block">
              <?php
                  if(!empty( $product->averageRating && $product->averageRating->value > 0)) {
                      ?>
                      <div class="rateit" data-rateit-value="<?php echo $product->averageRating->value; ?>" data-rateit-readonly="true" data-rateit-ispreset="true"></div>
                      <?php
                  }
              ?>
              <p>
                  <?php
                      $comment_count = count($product->comments);
                      echo Html::a(( $comment_count ? 'Отзывов: ' . count($product->comments) : "Оставить отзыв" ), [
                          'catalog/product',
                          'product' => $product,
                          '#'       => 'artbox-comment',
                      ]);
                  ?>
              </p>
          </div>
          <div><a href="<?= Url::to([
                  'catalog/product',
                  'product' => $product,
                  '#'       => 'm' . $product->variant->product_variant_id,
              ]) ?>"
                  class="name"><?= $product->fullnamewithcategory ?>
              </a></div>
          
          <?php
              
              echo '<div class="cost-block">';
  
              // есть скидка
          echo '<p  class="cost">';
              if($product->variant->price_old != 0 && $product->variant->price_old != $product->variant->price) {
                  echo '<strike><span id=\'old_cost\'>' . $product->variant->price_old . '</span> грн.</strike>&nbsp;';
                  echo $product->variant->price . ' <span>грн.</span></p>';
              } else {
                  echo '<span>'.$product->variant->price . ' </span><span>грн.</span></p>';
              }
              echo '</div>';
          
          ?>
      </div>
      <a href="<?= Url::to([
          'catalog/product',
          'product' => $product,
          '#'       => 'm' . $product->variant->product_variant_id,
      ]) ?>" class="<?= $product->variant->price > 0 ? "link_buy" : "link_buy_out_stock"?>"><?= $product->variant->price > 0 ? "Купить" : "Нет в наличии"?></a>
      
      <div class="mycarousel">
          <ul class="jcarousel jcarousel-skin-tango">
              <?php foreach($product->variants as $variant) : ?>
                  <?php if(!empty( $variant->image )) : ?>
                      <li>
                          <a href="<?= Url::to([
                              'catalog/product',
                              'product' => $product,
                              '#'       => 'm' . $variant->product_variant_id,
                          ]) ?>">
                              <?= \common\components\artboximage\ArtboxImageHelper::getImage($variant->imageUrl, 'product_variant', [
                                  'alt'   => $product->category->categoryName->value . ' ' . $product->fullname,
                                  'title' => $product->category->categoryName->value . ' ' . $product->fullname,
                              ]) ?>
                          </a>
                      </li>
                  <?php endif; ?>
              <?php endforeach; ?>
          </ul>
      </div>
  </li>