product_item.php
4.93 KB
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
113
<?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" itemscope itemtype="http://schema.org/Product">
<div class="boxitem">
<div class="pixbox">
<a href="<?= Url::to([
'catalog/product',
'product' => $product,
'#' => 'm' . $product->enabledVariants[ 0 ]->product_variant_id,
]) ?>">
<?= \common\components\artboximage\ArtboxImageHelper::getImage($product->enabledVariants[ 0 ]->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>promo</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 itemprop="name"><a href="<?= Url::to([
'catalog/product',
'product' => $product,
'#' => 'm' . $product->enabledVariants[ 0 ]->product_variant_id,
]) ?>"
class="name"><?= $product->fullname ?>
</a></div>
<?php
echo '<div class="cost-block" itemprop="offers" itemscope itemtype="http://schema.org/Offer">';
// есть скидка
echo '<p class="cost">';
if($product->enabledVariants[ 0 ]->price_old != 0 && $product->enabledVariants[ 0 ]->price_old != $product->enabledVariants[ 0 ]->price) {
echo '<strike><span id=\'old_cost\' itemprop="price">' . $product->enabledVariants[0]->price_old . '</span> грн.</strike> ';
echo $product->enabledVariants[0]->price . ' <span>грн.</span></p>';
} else {
echo '<span itemprop="price">'.$product->enabledVariants[0]->price . ' </span><span>грн.</span></p>';
}
echo '<meta itemprop="priceCurrency" content = "UAH">';
echo '</div>';
?>
</div>
<a href="<?= Url::to([
'catalog/product',
'product' => $product,
'#' => 'm' . $product->enabledVariants[ 0 ]->product_variant_id,
]) ?>" class="link_buy">Купить</a>
<div class="mycarousel">
<ul class="jcarousel jcarousel-skin-tango">
<?php foreach($product->enabledVariants 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>