Commit 0f8aaa74a51d38906edab311b77a624d9fc7b172
1 parent
e6001016
Image alt + title
Showing
2 changed files
with
235 additions
and
145 deletions
Show diff stats
frontend/views/catalog/product.php
@@ -7,21 +7,25 @@ | @@ -7,21 +7,25 @@ | ||
7 | // use common\modules\comment\widgets\CommentWidget; | 7 | // use common\modules\comment\widgets\CommentWidget; |
8 | use common\modules\comment\widgets\CommentWidget; | 8 | use common\modules\comment\widgets\CommentWidget; |
9 | use common\modules\product\models\Category; | 9 | use common\modules\product\models\Category; |
10 | -use yii\helpers\Html; | ||
11 | -use yii\web\View; | 10 | + use yii\helpers\Html; |
11 | + use yii\web\View; | ||
12 | use yii\helpers\Url; | 12 | use yii\helpers\Url; |
13 | use frontend\widgets\Seo; | 13 | use frontend\widgets\Seo; |
14 | -use frontend\assets\FlipclockAsset; | ||
15 | -FlipclockAsset::register($this); | 14 | + use frontend\assets\FlipclockAsset; |
15 | + | ||
16 | + FlipclockAsset::register($this); | ||
17 | + $fullname = $product->fullname; | ||
16 | $this->params[ 'seo' ][ 'key' ] = $category->categoryName->value; | 18 | $this->params[ 'seo' ][ 'key' ] = $category->categoryName->value; |
17 | - $this->params[ 'seo' ][ 'fields' ][ 'name' ] = $product->fullname; | ||
18 | - $this->params[ 'seo' ][ 'h1' ] = !empty( Seo::widget([ 'row' => 'h1' ]) ) ? Seo::widget([ 'row' => 'h1' ]) : $product->fullname; | 19 | + $this->params[ 'seo' ][ 'fields' ][ 'name' ] = $fullname; |
20 | + $this->params[ 'seo' ][ 'h1' ] = !empty( Seo::widget([ 'row' => 'h1' ]) ) ? Seo::widget( | ||
21 | + [ 'row' => 'h1' ] | ||
22 | + ) : $fullname; | ||
19 | 23 | ||
20 | - //$this->params['seo']['title'] = "Купить " . substr($product->category->categoryName->value, 0, -2) . " " . $product->fullname . " в Киеве, Харькове, Украине: цены, отзывы - Rukzachok.com.ua"; | ||
21 | - //$this->params['seo']['description'] = "Заказать " . substr($product->category->categoryName->value, 0, -2) . " " . $product->fullname . " - самые модные и стильные рюкзаки в Украине по лучшим ценам. Интернет магазин рюкзаков Rukzachok.com.ua"; | ||
22 | - $this->title = $product->fullname; | ||
23 | - //$this->title = (! empty($product->meta_title)) ? $product->meta_title : $product->fullname; | ||
24 | - //$this->registerMetaTag (['name' => 'description', 'content' => ((! empty($product->meta_description)) ? $product->meta_description : $product->fullname)]); | 24 | + //$this->params['seo']['title'] = "Купить " . substr($product->category->categoryName->value, 0, -2) . " " . $fullname . " в Киеве, Харькове, Украине: цены, отзывы - Rukzachok.com.ua"; |
25 | + //$this->params['seo']['description'] = "Заказать " . substr($product->category->categoryName->value, 0, -2) . " " . $fullname . " - самые модные и стильные рюкзаки в Украине по лучшим ценам. Интернет магазин рюкзаков Rukzachok.com.ua"; | ||
26 | + $this->title = $fullname; | ||
27 | + //$this->title = (! empty($product->meta_title)) ? $product->meta_title : $fullname; | ||
28 | + //$this->registerMetaTag (['name' => 'description', 'content' => ((! empty($product->meta_description)) ? $product->meta_description : $fullname)]); | ||
25 | //$this->registerMetaTag (['name' => 'keywords', 'content' => $product->meta_keywords]); | 29 | //$this->registerMetaTag (['name' => 'keywords', 'content' => $product->meta_keywords]); |
26 | 30 | ||
27 | //foreach($product->category->getParents()->all() as $parent) { | 31 | //foreach($product->category->getParents()->all() as $parent) { |
@@ -39,18 +43,19 @@ FlipclockAsset::register($this); | @@ -39,18 +43,19 @@ FlipclockAsset::register($this); | ||
39 | ], | 43 | ], |
40 | ]; | 44 | ]; |
41 | $this->params[ 'breadcrumbs' ][] = [ | 45 | $this->params[ 'breadcrumbs' ][] = [ |
42 | - 'label' => $category->name.' '.$product->brand->name, | 46 | + 'label' => $category->name . ' ' . $product->brand->name, |
43 | 'url' => [ | 47 | 'url' => [ |
44 | 'catalog/category', | 48 | 'catalog/category', |
45 | 'category' => $category, | 49 | 'category' => $category, |
46 | - 'filters' => [ | ||
47 | - 'brands' => [$product->brand->alias] | ||
48 | - ] | 50 | + 'filters' => [ |
51 | + 'brands' => [ $product->brand->alias ], | ||
52 | + ], | ||
49 | ], | 53 | ], |
50 | ]; | 54 | ]; |
51 | - $this->params[ 'breadcrumbs' ][] = $product->fullname . ' #' . $product->variant->sku; | 55 | + $this->params[ 'breadcrumbs' ][] = $fullname . ' #' . $product->variant->sku; |
52 | 56 | ||
53 | - $this->registerJs(' | 57 | + $this->registerJs( |
58 | + ' | ||
54 | 59 | ||
55 | var checkData = function($index) | 60 | var checkData = function($index) |
56 | { | 61 | { |
@@ -94,9 +99,13 @@ FlipclockAsset::register($this); | @@ -94,9 +99,13 @@ FlipclockAsset::register($this); | ||
94 | 99 | ||
95 | checkData(0); | 100 | checkData(0); |
96 | 101 | ||
97 | - ', View::POS_READY, 'fasovka'); | 102 | + ', |
103 | + View::POS_READY, | ||
104 | + 'fasovka' | ||
105 | + ); | ||
98 | 106 | ||
99 | - $this->registerJs(" | 107 | + $this->registerJs( |
108 | + " | ||
100 | $('#nav_product li > a').addClass('active'); | 109 | $('#nav_product li > a').addClass('active'); |
101 | $('#nav_product li').find('.info').toggle(); | 110 | $('#nav_product li').find('.info').toggle(); |
102 | 111 | ||
@@ -108,43 +117,60 @@ FlipclockAsset::register($this); | @@ -108,43 +117,60 @@ FlipclockAsset::register($this); | ||
108 | 117 | ||
109 | return false; | 118 | return false; |
110 | }); | 119 | }); |
111 | - ", View::POS_READY, 'nav_product'); | 120 | + ", |
121 | + View::POS_READY, | ||
122 | + 'nav_product' | ||
123 | + ); | ||
112 | 124 | ||
113 | $this->registerCssFile(Yii::$app->request->BaseUrl . '/js/shadowbox-3.0.3/shadowbox.css'); | 125 | $this->registerCssFile(Yii::$app->request->BaseUrl . '/js/shadowbox-3.0.3/shadowbox.css'); |
114 | - $this->registerJsFile(Yii::$app->request->baseUrl . '/js/shadowbox-3.0.3/shadowbox.js', [ | ||
115 | - 'position' => View::POS_END, | ||
116 | - 'depends' => [ 'yii\web\JqueryAsset' ], | ||
117 | - ]); | ||
118 | - $this->registerJs(" | 126 | + $this->registerJsFile( |
127 | + Yii::$app->request->baseUrl . '/js/shadowbox-3.0.3/shadowbox.js', | ||
128 | + [ | ||
129 | + 'position' => View::POS_END, | ||
130 | + 'depends' => [ 'yii\web\JqueryAsset' ], | ||
131 | + ] | ||
132 | + ); | ||
133 | + $this->registerJs( | ||
134 | + " | ||
119 | Shadowbox.init({ | 135 | Shadowbox.init({ |
120 | 136 | ||
121 | }); | 137 | }); |
122 | - ", View::POS_READY, 'Shadowbox'); | 138 | + ", |
139 | + View::POS_READY, | ||
140 | + 'Shadowbox' | ||
141 | + ); | ||
123 | ?> | 142 | ?> |
124 | 143 | ||
125 | -<?php if($flash = Yii::$app->session->getFlash('success')): ?> | 144 | +<?php if ($flash = Yii::$app->session->getFlash('success')): ?> |
126 | <div class="alert-success"><?= $flash ?></div> | 145 | <div class="alert-success"><?= $flash ?></div> |
127 | <?php endif; ?> | 146 | <?php endif; ?> |
128 | <div class="loyout"> | 147 | <div class="loyout"> |
129 | <div itemscope itemtype="http://schema.org/Product"> | 148 | <div itemscope itemtype="http://schema.org/Product"> |
130 | <div class="productLeftBar"> | 149 | <div class="productLeftBar"> |
131 | <div itemprop="name"><h1><?= Seo::widget([ 'row' => 'h1' ]) ?></h1></div> | 150 | <div itemprop="name"><h1><?= Seo::widget([ 'row' => 'h1' ]) ?></h1></div> |
132 | - <?php foreach($product->enabledVariantsGrouped as $variantGroup) : ?> | 151 | + <?php foreach ($product->enabledVariantsGrouped as $variantGroup) : ?> |
133 | <div class="begin"><?= $variantGroup->name2 ?></div> | 152 | <div class="begin"><?= $variantGroup->name2 ?></div> |
134 | <ul class="product_mod"> | 153 | <ul class="product_mod"> |
135 | - <?php foreach($variantGroup->_variants as $variant): ?> | 154 | + <?php foreach ($variantGroup->_variants as $variant): ?> |
136 | <li> | 155 | <li> |
137 | <a id='m<?= $variant->product_variant_id ?>' href="#<?= $variant->product_variant_id ?>" | 156 | <a id='m<?= $variant->product_variant_id ?>' href="#<?= $variant->product_variant_id ?>" |
138 | data-cost="<?= $variant->price ?>" | 157 | data-cost="<?= $variant->price ?>" |
139 | data-old_cost="<?= $variant->price_old ?>" data-id="<?= $variant->product_variant_id ?>" data-art="<?= $variant->sku ?>" | 158 | data-old_cost="<?= $variant->price_old ?>" data-id="<?= $variant->product_variant_id ?>" data-art="<?= $variant->sku ?>" |
140 | data-color="<?= $variant->name ?>" | 159 | data-color="<?= $variant->name ?>" |
141 | - data-image="<?= \common\components\artboximage\ArtboxImageHelper::getImageSrc($variant->imageUrl, 'product_view') ?>" | 160 | + data-image="<?= \common\components\artboximage\ArtboxImageHelper::getImageSrc( |
161 | + $variant->imageUrl, | ||
162 | + 'product_view' | ||
163 | + ) ?>" | ||
142 | data-imageoriginal="<?= $variant->imageUrl ?>" | 164 | data-imageoriginal="<?= $variant->imageUrl ?>" |
143 | - title="<?= $product->fullname ?>"> | ||
144 | - <?= \common\components\artboximage\ArtboxImageHelper::getImage($variant->imageUrl, 'product_variant', [ | ||
145 | - 'alt' => $category->categoryName->value . ' ' . $product->fullname, | ||
146 | - 'title' => $category->categoryName->value . ' ' . $product->fullname, | ||
147 | - ]) ?> | 165 | + title="<?= $fullname ?>"> |
166 | + <?= \common\components\artboximage\ArtboxImageHelper::getImage( | ||
167 | + $variant->imageUrl, | ||
168 | + 'product_variant', | ||
169 | + [ | ||
170 | + 'alt' => $fullname, | ||
171 | + 'title' => $fullname, | ||
172 | + ] | ||
173 | + ) ?> | ||
148 | </a> | 174 | </a> |
149 | </li> | 175 | </li> |
150 | <?php endforeach; ?> | 176 | <?php endforeach; ?> |
@@ -158,12 +184,12 @@ FlipclockAsset::register($this); | @@ -158,12 +184,12 @@ FlipclockAsset::register($this); | ||
158 | <span id='color'></span></div> | 184 | <span id='color'></span></div> |
159 | <div class="product_read_price"> | 185 | <div class="product_read_price"> |
160 | <div class="w"> | 186 | <div class="w"> |
161 | - <strike><span><span id='old_cost'><?= $product->variant->price_old >0 ? $product->variant->price_old : 0?></span></span> грн.</strike> | 187 | + <strike><span><span id='old_cost'><?= $product->variant->price_old > 0 ? $product->variant->price_old : 0 ?></span></span> грн.</strike> |
162 | <span class="cost"><span itemprop="price"><span id='cost'><?= $product->variant->price ?></span></span> <span class="valute">грн.</span></span> | 188 | <span class="cost"><span itemprop="price"><span id='cost'><?= $product->variant->price ?></span></span> <span class="valute">грн.</span></span> |
163 | <meta itemprop="priceCurrency" content="UAH"> | 189 | <meta itemprop="priceCurrency" content="UAH"> |
164 | </div> | 190 | </div> |
165 | <input type='hidden' id='product_id'/> | 191 | <input type='hidden' id='product_id'/> |
166 | - <a href="#" rel='<?= $product->variant->price > 0 ? "product" : ""?>' class="<?= $product->variant->price > 0 ? "link_buy" : "link_buy_out_stock"?>"><?= $product->variant->price > 0 ? "Купить" : "Нет в наличии"?></a> | 192 | + <a href="#" rel='<?= $product->variant->price > 0 ? "product" : "" ?>' class="<?= $product->variant->price > 0 ? "link_buy" : "link_buy_out_stock" ?>"><?= $product->variant->price > 0 ? "Купить" : "Нет в наличии" ?></a> |
167 | <div class="both"></div> | 193 | <div class="both"></div> |
168 | </div> | 194 | </div> |
169 | </div> | 195 | </div> |
@@ -174,33 +200,41 @@ FlipclockAsset::register($this); | @@ -174,33 +200,41 @@ FlipclockAsset::register($this); | ||
174 | </div> | 200 | </div> |
175 | <div class="product_service"> | 201 | <div class="product_service"> |
176 | <ul> | 202 | <ul> |
177 | - <?php if(Yii::$app->user->id) : ?> | ||
178 | - <li class="item1"><a href="<?= Url::to([ | ||
179 | - 'iam/share', | ||
180 | - 'id' => $product->product_id, | ||
181 | - ]) ?>">Добавить в закладки</a></li> | 203 | + <?php if (Yii::$app->user->id) : ?> |
204 | + <li class="item1"><a href="<?= Url::to( | ||
205 | + [ | ||
206 | + 'iam/share', | ||
207 | + 'id' => $product->product_id, | ||
208 | + ] | ||
209 | + ) ?>">Добавить в закладки</a></li> | ||
182 | <?php endif ?> | 210 | <?php endif ?> |
183 | - <?php if(false && Yii::$app->user->id) : ?> | ||
184 | - <li class="item2"><a href="<?= Url::to([ | ||
185 | - 'iam/price', | ||
186 | - 'id' => $product->product_id, | ||
187 | - ]) ?>">Узнать о снижение цены</a></li> | 211 | + <?php if (false && Yii::$app->user->id) : ?> |
212 | + <li class="item2"><a href="<?= Url::to( | ||
213 | + [ | ||
214 | + 'iam/price', | ||
215 | + 'id' => $product->product_id, | ||
216 | + ] | ||
217 | + ) ?>">Узнать о снижение цены</a></li> | ||
188 | <?php endif ?> | 218 | <?php endif ?> |
189 | - <?php if(false) : ?> | ||
190 | - <li class="item3"><a href="<?= Url::to([ | ||
191 | - 'products/compare', | ||
192 | - 'id' => $product->product_id, | ||
193 | - ]) ?>">Добавить в сравнение</a></li> | 219 | + <?php if (false) : ?> |
220 | + <li class="item3"><a href="<?= Url::to( | ||
221 | + [ | ||
222 | + 'products/compare', | ||
223 | + 'id' => $product->product_id, | ||
224 | + ] | ||
225 | + ) ?>">Добавить в сравнение</a></li> | ||
194 | <?php endif ?> | 226 | <?php endif ?> |
195 | </ul> | 227 | </ul> |
196 | </div> | 228 | </div> |
197 | <div class="artbox_comment_description"> | 229 | <div class="artbox_comment_description"> |
198 | <?php | 230 | <?php |
199 | - if(!empty( $product->averageRating ) && $product->averageRating->value) { | 231 | + if (!empty( $product->averageRating ) && $product->averageRating->value) { |
200 | ?> | 232 | ?> |
201 | <div itemprop="aggregateRating" class="product_rating_block" itemscope itemtype="http://schema.org/AggregateRating"> | 233 | <div itemprop="aggregateRating" class="product_rating_block" itemscope itemtype="http://schema.org/AggregateRating"> |
202 | <span itemprop="ratingValue" style="display: none"><?php echo $product->averageRating->value; ?></span> | 234 | <span itemprop="ratingValue" style="display: none"><?php echo $product->averageRating->value; ?></span> |
203 | - <span itemprop="ratingCount" style="display: none"><?php echo count($product->comments); ?></span> | 235 | + <span itemprop="ratingCount" style="display: none"><?php echo count( |
236 | + $product->comments | ||
237 | + ); ?></span> | ||
204 | <div class="rateit" data-rateit-value="<?php echo $product->averageRating->value; ?>" data-rateit-readonly="true" data-rateit-ispreset="true"></div> | 238 | <div class="rateit" data-rateit-value="<?php echo $product->averageRating->value; ?>" data-rateit-readonly="true" data-rateit-ispreset="true"></div> |
205 | </div> | 239 | </div> |
206 | <?php | 240 | <?php |
@@ -209,7 +243,7 @@ FlipclockAsset::register($this); | @@ -209,7 +243,7 @@ FlipclockAsset::register($this); | ||
209 | <p class="product_review_block"><a href="#artbox-comment" itemprop="interactionCount"> | 243 | <p class="product_review_block"><a href="#artbox-comment" itemprop="interactionCount"> |
210 | <?php | 244 | <?php |
211 | $comment_count = count($product->comments); | 245 | $comment_count = count($product->comments); |
212 | - if($comment_count) { | 246 | + if ($comment_count) { |
213 | echo "Отзывов: " . $comment_count; | 247 | echo "Отзывов: " . $comment_count; |
214 | } else { | 248 | } else { |
215 | echo "Оставить отзыв"; | 249 | echo "Оставить отзыв"; |
@@ -248,82 +282,101 @@ FlipclockAsset::register($this); | @@ -248,82 +282,101 @@ FlipclockAsset::register($this); | ||
248 | </div> | 282 | </div> |
249 | 283 | ||
250 | <div class="productRightBar"> | 284 | <div class="productRightBar"> |
251 | - <?php foreach($product->events as $event):?> | ||
252 | - <?php if(!empty($event->end_at) && $event->isActive()):?> | 285 | + <?php foreach ($product->events as $event): ?> |
286 | + <?php if (!empty( $event->end_at ) && $event->isActive()): ?> | ||
253 | <div class="event_block"> | 287 | <div class="event_block"> |
254 | - | ||
255 | - <div class="event_title"> <?= Html::a('Акция!!! '.$event->name,Url::to(['event/show','alias'=>$event->alias,'id'=>$event->primaryKey]))?></div> | 288 | + |
289 | + <div class="event_title"> <?= Html::a( | ||
290 | + 'Акция!!! ' . $event->name, | ||
291 | + Url::to( | ||
292 | + [ | ||
293 | + 'event/show', | ||
294 | + 'alias' => $event->alias, | ||
295 | + 'id' => $event->primaryKey, | ||
296 | + ] | ||
297 | + ) | ||
298 | + ) ?></div> | ||
256 | <div class="event_time">До конца осталось:</div> | 299 | <div class="event_time">До конца осталось:</div> |
257 | <div class="clock_<?= $event->primaryKey ?> clock_product_first "></div> | 300 | <div class="clock_<?= $event->primaryKey ?> clock_product_first "></div> |
258 | <script type="text/javascript"> | 301 | <script type="text/javascript"> |
259 | var clock; | 302 | var clock; |
260 | - | ||
261 | - $(document).ready(function() { | ||
262 | - var clock; | ||
263 | - | ||
264 | - clock = $('.clock_<?= $event->primaryKey ?>').FlipClock({ | ||
265 | - clockFace: 'DailyCounter', | ||
266 | - language: 'ru', | ||
267 | - classes: { | ||
268 | - active: 'flip-clock-active', | ||
269 | - before: 'flip-clock-before', | ||
270 | - divider: 'flip-clock-divider', | ||
271 | - dot: 'flip-clock-dot', | ||
272 | - label: 'flip-clock-label', | ||
273 | - flip: 'flip', | ||
274 | - play: 'play', | ||
275 | - wrapper: 'flip-clock-wrapper' | ||
276 | - }, | ||
277 | - }); | ||
278 | - | ||
279 | - clock.setTime(<?= strtotime($event->end_at) - strtotime(date("Y-m-d H:i:s"))?>); | ||
280 | - clock.setCountdown(true); | ||
281 | - clock.start(); | ||
282 | - | ||
283 | - }); | 303 | + |
304 | + $(document) | ||
305 | + .ready( | ||
306 | + function() { | ||
307 | + var clock; | ||
308 | + | ||
309 | + clock = $('.clock_<?= $event->primaryKey ?>') | ||
310 | + .FlipClock( | ||
311 | + { | ||
312 | + clockFace: 'DailyCounter', | ||
313 | + language: 'ru', | ||
314 | + classes: { | ||
315 | + active: 'flip-clock-active', | ||
316 | + before: 'flip-clock-before', | ||
317 | + divider: 'flip-clock-divider', | ||
318 | + dot: 'flip-clock-dot', | ||
319 | + label: 'flip-clock-label', | ||
320 | + flip: 'flip', | ||
321 | + play: 'play', | ||
322 | + wrapper: 'flip-clock-wrapper' | ||
323 | + }, | ||
324 | + } | ||
325 | + ); | ||
326 | + | ||
327 | + clock.setTime(<?= strtotime($event->end_at) - strtotime( | ||
328 | + date("Y-m-d H:i:s") | ||
329 | + )?>); | ||
330 | + clock.setCountdown(true); | ||
331 | + clock.start(); | ||
332 | + | ||
333 | + } | ||
334 | + ); | ||
284 | </script> | 335 | </script> |
285 | - | 336 | + |
286 | </div> | 337 | </div> |
287 | <?php endif; ?> | 338 | <?php endif; ?> |
288 | <?php endforeach; ?> | 339 | <?php endforeach; ?> |
289 | - | 340 | + |
290 | <ul id="nav_product"> | 341 | <ul id="nav_product"> |
291 | <li><a href="#">Характеристики</a> | 342 | <li><a href="#">Характеристики</a> |
292 | <div class="info"> | 343 | <div class="info"> |
293 | - <p>Бренд: <?= Html::a($product->brand->name, [ | ||
294 | - 'catalog/category', | ||
295 | - 'category' => $category, | ||
296 | - 'filters' => [ | ||
297 | - 'brands' => [$product->brand->alias] | ||
298 | - ] | ||
299 | - ]) | ||
300 | - ?></p> | ||
301 | - <?php foreach($product->getActiveProperties($category->category_id) as $group): ?> | 344 | + <p>Бренд: <?= Html::a( |
345 | + $product->brand->name, | ||
346 | + [ | ||
347 | + 'catalog/category', | ||
348 | + 'category' => $category, | ||
349 | + 'filters' => [ | ||
350 | + 'brands' => [ $product->brand->alias ], | ||
351 | + ], | ||
352 | + ] | ||
353 | + ) ?></p> | ||
354 | + <?php foreach ($product->getActiveProperties($category->category_id) as $group): ?> | ||
302 | <p> | 355 | <p> |
303 | <?php | 356 | <?php |
304 | - echo $group->name .' '; | 357 | + echo $group->name . ' '; |
305 | $i = 1; | 358 | $i = 1; |
306 | - foreach($group->_options as $option) { | ||
307 | - if ($group->is_filter) { | ||
308 | - echo Html::a( | ||
309 | - $option->ValueRenderHTML, | ||
310 | - [ | ||
311 | - 'catalog/category', | ||
312 | - 'category' => $category, | ||
313 | - 'filters' => [ | ||
314 | - $group->alias => [ $option->alias ], | ||
315 | - ], | ||
316 | - ] | ||
317 | - ); | ||
318 | - } else { | ||
319 | - echo $option->ValueRenderHTML; | ||
320 | - } | ||
321 | - if (count($group->_options) != $i) { | ||
322 | - echo ', '; | ||
323 | - } | ||
324 | - $i++; | 359 | + foreach ($group->_options as $option) { |
360 | + if ($group->is_filter) { | ||
361 | + echo Html::a( | ||
362 | + $option->ValueRenderHTML, | ||
363 | + [ | ||
364 | + 'catalog/category', | ||
365 | + 'category' => $category, | ||
366 | + 'filters' => [ | ||
367 | + $group->alias => [ $option->alias ], | ||
368 | + ], | ||
369 | + ] | ||
370 | + ); | ||
371 | + } else { | ||
372 | + echo $option->ValueRenderHTML; | ||
373 | + } | ||
374 | + if (count($group->_options) != $i) { | ||
375 | + echo ', '; | ||
376 | + } | ||
377 | + $i++; | ||
325 | } | 378 | } |
326 | - unset($i); | 379 | + unset( $i ); |
327 | ?> | 380 | ?> |
328 | </p> | 381 | </p> |
329 | <?php endforeach; ?> | 382 | <?php endforeach; ?> |
@@ -336,16 +389,26 @@ FlipclockAsset::register($this); | @@ -336,16 +389,26 @@ FlipclockAsset::register($this); | ||
336 | </div> | 389 | </div> |
337 | </div> | 390 | </div> |
338 | </li> | 391 | </li> |
339 | - <?php if(!empty( $product->video ) && strpos($product->video, '.jpg') === false && strpos($product->video, '.png') === false) : ?> | 392 | + <?php if (!empty( $product->video ) && strpos($product->video, '.jpg') === false && strpos( |
393 | + $product->video, | ||
394 | + '.png' | ||
395 | + ) === false | ||
396 | + ) : ?> | ||
340 | <li><a href="#">Видео</a> | 397 | <li><a href="#">Видео</a> |
341 | <div class="info product-thumb-video"> | 398 | <div class="info product-thumb-video"> |
342 | - <?php if(strpos($product->video, '<iframe') !== false || strpos($product->video, '<object') !== false) : ?> | 399 | + <?php if (strpos($product->video, '<iframe') !== false || strpos( |
400 | + $product->video, | ||
401 | + '<object' | ||
402 | + ) !== false | ||
403 | + ) : ?> | ||
343 | <?= $product->video ?> | 404 | <?= $product->video ?> |
344 | <?php else : ?> | 405 | <?php else : ?> |
345 | - <?= \cics\widgets\VideoEmbed::widget([ | ||
346 | - 'responsive' => false, | ||
347 | - 'url' => $product->video, | ||
348 | - ]) ?> | 406 | + <?= \cics\widgets\VideoEmbed::widget( |
407 | + [ | ||
408 | + 'responsive' => false, | ||
409 | + 'url' => $product->video, | ||
410 | + ] | ||
411 | + ) ?> | ||
349 | <?php endif ?> | 412 | <?php endif ?> |
350 | </div> | 413 | </div> |
351 | </li> | 414 | </li> |
@@ -355,38 +418,60 @@ FlipclockAsset::register($this); | @@ -355,38 +418,60 @@ FlipclockAsset::register($this); | ||
355 | <div class="content"> | 418 | <div class="content"> |
356 | <div class="pic"> | 419 | <div class="pic"> |
357 | <center> | 420 | <center> |
358 | - <a href="#" rel="shadowbox[gal]" id="picoriginal"><?= \common\components\artboximage\ArtboxImageHelper::getImage($product->variant->imageUrl, 'product_view', [ | ||
359 | - 'id' => 'pic', | ||
360 | - 'alt' => $category->categoryName->value . ' ' . $product->fullname, | ||
361 | - 'title' => $category->categoryName->value . ' ' . $product->fullname, | ||
362 | - ]) ?></a> | 421 | + <a href="#" rel="shadowbox[gal]" id="picoriginal"><?= \common\components\artboximage\ArtboxImageHelper::getImage( |
422 | + $product->variant->imageUrl, | ||
423 | + 'product_view', | ||
424 | + [ | ||
425 | + 'id' => 'pic', | ||
426 | + 'alt' => $fullname, | ||
427 | + 'title' => $fullname, | ||
428 | + ] | ||
429 | + ) ?></a> | ||
363 | </center> | 430 | </center> |
364 | </div> | 431 | </div> |
365 | <ul class="product_colors"> | 432 | <ul class="product_colors"> |
366 | - <?php foreach($product->images as $image): ?> | 433 | + <?php foreach ($product->images as $image): ?> |
367 | <li><a href="<?= $image->imageUrl ?>" rel="shadowbox[gal]"> | 434 | <li><a href="<?= $image->imageUrl ?>" rel="shadowbox[gal]"> |
368 | - <?= \common\components\artboximage\ArtboxImageHelper::getImage($image->imageUrl, 'product_trumb2', [ | ||
369 | - 'alt' => $category->categoryName->value . ' ' . $product->fullname, | ||
370 | - 'title' => $category->categoryName->value . ' ' . $product->fullname, | ||
371 | - ]) ?> | 435 | + <?= \common\components\artboximage\ArtboxImageHelper::getImage( |
436 | + $image->imageUrl, | ||
437 | + 'product_trumb2', | ||
438 | + [ | ||
439 | + 'alt' => $fullname, | ||
440 | + 'title' => $fullname, | ||
441 | + ] | ||
442 | + ) ?> | ||
372 | </a></li> | 443 | </a></li> |
373 | <?php endforeach; ?> | 444 | <?php endforeach; ?> |
374 | </ul> | 445 | </ul> |
375 | </div> | 446 | </div> |
376 | <div class="events"> | 447 | <div class="events"> |
377 | - <?php foreach($product->events as $event):?> | ||
378 | - <?php if(!empty($event->banner) && $event->isActive()):?> | ||
379 | - <?= Html::a(\common\components\artboximage\ArtboxImageHelper::getImage($event->bannerUrl, 'event_in_product'),Url::to(['event/show','alias'=>$event->alias,'id'=>$event->primaryKey]))?> | 448 | + <?php foreach ($product->events as $event): ?> |
449 | + <?php if (!empty( $event->banner ) && $event->isActive()): ?> | ||
450 | + <?= Html::a( | ||
451 | + \common\components\artboximage\ArtboxImageHelper::getImage( | ||
452 | + $event->bannerUrl, | ||
453 | + 'event_in_product' | ||
454 | + ), | ||
455 | + Url::to( | ||
456 | + [ | ||
457 | + 'event/show', | ||
458 | + 'alias' => $event->alias, | ||
459 | + 'id' => $event->primaryKey, | ||
460 | + ] | ||
461 | + ) | ||
462 | + ) ?> | ||
380 | <?php endif; ?> | 463 | <?php endif; ?> |
381 | <?php endforeach; ?> | 464 | <?php endforeach; ?> |
382 | </div> | 465 | </div> |
383 | - | 466 | + |
384 | <div class="both"></div> | 467 | <div class="both"></div> |
385 | <div class="comment-wrapper" style="padding-bottom:25px"> | 468 | <div class="comment-wrapper" style="padding-bottom:25px"> |
386 | <?php | 469 | <?php |
387 | - echo CommentWidget::widget([ | ||
388 | - 'model' => $product, | ||
389 | - ]); | 470 | + echo CommentWidget::widget( |
471 | + [ | ||
472 | + 'model' => $product, | ||
473 | + ] | ||
474 | + ); | ||
390 | ?> | 475 | ?> |
391 | <div class="both"></div> | 476 | <div class="both"></div> |
392 | </div> | 477 | </div> |
@@ -399,7 +484,8 @@ FlipclockAsset::register($this); | @@ -399,7 +484,8 @@ FlipclockAsset::register($this); | ||
399 | <?= \common\modules\product\widgets\lastProducts::widget() ?> | 484 | <?= \common\modules\product\widgets\lastProducts::widget() ?> |
400 | </div> | 485 | </div> |
401 | <?php | 486 | <?php |
402 | - $this->registerJs(" | 487 | + $this->registerJs( |
488 | + " | ||
403 | var productHash = window.location.hash; | 489 | var productHash = window.location.hash; |
404 | productHash = productHash.replace('#','') | 490 | productHash = productHash.replace('#','') |
405 | 491 | ||
@@ -412,5 +498,8 @@ FlipclockAsset::register($this); | @@ -412,5 +498,8 @@ FlipclockAsset::register($this); | ||
412 | 498 | ||
413 | $('#pic').attr('src',dataImg) | 499 | $('#pic').attr('src',dataImg) |
414 | $('#pic').parent().attr('href',dataLink) | 500 | $('#pic').parent().attr('href',dataLink) |
415 | - ", View::POS_READY, 'new_script'); | 501 | + ", |
502 | + View::POS_READY, | ||
503 | + 'new_script' | ||
504 | + ); | ||
416 | ?> | 505 | ?> |
417 | \ No newline at end of file | 506 | \ No newline at end of file |
frontend/views/catalog/product_item.php
@@ -6,6 +6,7 @@ | @@ -6,6 +6,7 @@ | ||
6 | 6 | ||
7 | Yii::$app->getModule('artbox-comment'); | 7 | Yii::$app->getModule('artbox-comment'); |
8 | CommentAsset::register($this); | 8 | CommentAsset::register($this); |
9 | + $fullname = $product->fullname; | ||
9 | ?> | 10 | ?> |
10 | <li class="item"> | 11 | <li class="item"> |
11 | <div class="boxitem"> | 12 | <div class="boxitem"> |
@@ -16,8 +17,8 @@ | @@ -16,8 +17,8 @@ | ||
16 | '#' => 'm' . $product->enabledVariants[ 0 ]->product_variant_id, | 17 | '#' => 'm' . $product->enabledVariants[ 0 ]->product_variant_id, |
17 | ]) ?>"> | 18 | ]) ?>"> |
18 | <?= \common\components\artboximage\ArtboxImageHelper::getImage($product->enabledVariants[ 0 ]->imageUrl, 'list', [ | 19 | <?= \common\components\artboximage\ArtboxImageHelper::getImage($product->enabledVariants[ 0 ]->imageUrl, 'list', [ |
19 | - 'alt' => $product->category->categoryName->value . ' ' . $product->fullname, | ||
20 | - 'title' => $product->category->categoryName->value . ' ' . $product->fullname, | 20 | + 'alt' => $fullname, |
21 | + 'title' => $fullname, | ||
21 | ]) ?> | 22 | ]) ?> |
22 | </a> | 23 | </a> |
23 | </div> | 24 | </div> |
@@ -64,7 +65,7 @@ | @@ -64,7 +65,7 @@ | ||
64 | 'product' => $product, | 65 | 'product' => $product, |
65 | '#' => 'm' . $product->enabledVariants[ 0 ]->product_variant_id, | 66 | '#' => 'm' . $product->enabledVariants[ 0 ]->product_variant_id, |
66 | ]) ?>" | 67 | ]) ?>" |
67 | - class="name"><?= $product->fullname ?> | 68 | + class="name"><?= $fullname ?> |
68 | </a></div> | 69 | </a></div> |
69 | 70 | ||
70 | <?php | 71 | <?php |
@@ -100,8 +101,8 @@ | @@ -100,8 +101,8 @@ | ||
100 | '#' => 'm' . $variant->product_variant_id, | 101 | '#' => 'm' . $variant->product_variant_id, |
101 | ]) ?>"> | 102 | ]) ?>"> |
102 | <?= \common\components\artboximage\ArtboxImageHelper::getImage($variant->imageUrl, 'product_variant', [ | 103 | <?= \common\components\artboximage\ArtboxImageHelper::getImage($variant->imageUrl, 'product_variant', [ |
103 | - 'alt' => $product->category->categoryName->value . ' ' . $product->fullname, | ||
104 | - 'title' => $product->category->categoryName->value . ' ' . $product->fullname, | 104 | + 'alt' => $fullname, |
105 | + 'title' => $fullname, | ||
105 | ]) ?> | 106 | ]) ?> |
106 | </a> | 107 | </a> |
107 | </li> | 108 | </li> |