Commit b1a416c36359c40a72f2fa246405c4d67bf529a6

Authored by Administrator
2 parents 036aa3d3 311e3534

Merge remote-tracking branch 'origin/master'

frontend/views/catalog/_product_item.php
... ... @@ -5,12 +5,12 @@
5 5 use yii\helpers\Html;
6 6 use yii\helpers\Url;
7 7 ?>
8   -<div class="catalog_item">
  8 +<div class="catalog_item" itemscope itemtype="http://schema.org/Product">
9 9 <div class="wrapper">
10 10 <div class="item_container" >
11 11 <input class="prodInfo" type="hidden" value="[]">
12 12 <div class="title">
13   - <?= Html::a( $model->name, Url::to(['catalog/product', 'product' => $model->alias]), ['class'=>'btn-product-details','data-pjax'=>0] )?>
  13 + <?= Html::a( $model->name, Url::to(['catalog/product', 'product' => $model->alias]), ['class'=>'btn-product-details','data-pjax'=>0, 'itemprop' => 'name'] )?>
14 14 </div>
15 15 <div class="img">
16 16 <a data-pjax=0 class="btn-product-details"
... ... @@ -37,7 +37,8 @@ use yii\helpers\Url;
37 37 <?= \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list', [
38 38 'alt' => $model->category->name . ' ' . $model->name,
39 39 'title' => $model->category->name . ' ' . $model->name,
40   - 'class' => 'selected'
  40 + 'class' => 'selected',
  41 + 'itemprop' => 'image'
41 42 ]) ?>
42 43 </a>
43 44 <div class="info_icons">
... ... @@ -57,7 +58,7 @@ use yii\helpers\Url;
57 58 </ul>
58 59 </div>
59 60 </div>
60   - <div class="price">
  61 + <div class="price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
61 62  
62 63 <?php if($model->variant->price_old){?>
63 64 <div class="dlexfduinxipi old_price-wr">
... ... @@ -69,7 +70,8 @@ use yii\helpers\Url;
69 70 <div class="dlexfduinxipi">
70 71 Цена:
71 72 <span class="main">
72   - <?= $model->variant->price ?>
  73 + <span itemprop="price"><?= $model->variant->price ?></span>
  74 + <meta itemprop="priceCurrency" content = "UAH" />
73 75 <span class="currency">грн</span>
74 76 </span>
75 77 </div>
... ...
frontend/views/catalog/product.php
... ... @@ -42,7 +42,7 @@
42 42  
43 43 <div class="wrapper white item_container">
44 44 <div class="container">
45   - <div class="product_detail">
  45 + <div class="product_detail" itemscope itemtype="http://schema.org/Product">
46 46  
47 47 <h1 itemprop="name"><?= Seo::widget([ 'row' => 'h1' ]) ?></h1>
48 48 <div class="product_code">Код:<?= $product->variant->sku ?></div>
... ... @@ -68,7 +68,8 @@
68 68 <a href="<?= $product->imageUrl ?>" data-lightbox="image-1" data-title="<?= $product->name;?>">
69 69 <?= ArtboxImageHelper::getImage($product->imageUrl, 'product_show',[
70 70 'alt'=>$product->name." фото 1" ,
71   - 'title' => $product->name." фото 1"
  71 + 'title' => $product->name." фото 1",
  72 + 'itemprop' => 'image'
72 73 ]) ?>
73 74 </a>
74 75  
... ... @@ -105,7 +106,7 @@
105 106 </ul>
106 107  
107 108 <div class="floating_helper_block_wrapper">
108   - <div class="floating_helper_block" style="visibility: visible; opacity: 1;">
  109 + <div class="floating_helper_block" style="visibility: visible; opacity: 1;" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
109 110 <table>
110 111 <tbody>
111 112 <tr>
... ... @@ -309,12 +310,12 @@
309 310 <div class="price">
310 311 <?php if($product->variant->price_old){?>
311 312 <span class="main">
312   - <span itemprop="price" class="price"><s><?= $product->variant->price_old ?></s></span>
  313 + <span class="price"><s><?= $product->variant->price_old ?></s></span>
313 314 <span class="currency">&nbsp;грн.</span>
314 315 </span>
315 316 <?php }?>
316 317 <span class="main">
317   - <span itemprop="price" class="price"><?= $product->variant->price ?></span>
  318 + <span class="price"><?= $product->variant->price ?></span>
318 319 <span class="currency">&nbsp;грн.</span>
319 320 </span>
320 321 </div>
... ... @@ -418,10 +419,10 @@
418 419 <?php
419 420 if(!empty( $product->averageRating )) {
420 421 ?>
421   - <div class="rating">
  422 + <div class="rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
422 423 <div class="rateit" data-rateit-value="<?php echo $product->averageRating->value; ?>" data-rateit-ispreset="true" data-rateit-readonly="true"></div>
423   - рейтинг: <span id="product_rate_avg"><?=$product->averageRating->value?></span>&nbsp;&nbsp;
424   - голосов: <span id="product_vote_count">
  424 + рейтинг: <span id="product_rate_avg" itemprop="ratingValue"><?=$product->averageRating->value?></span>&nbsp;&nbsp;
  425 + голосов: <span id="product_vote_count" itemprop="ratingCount">
425 426 <?php
426 427 echo count($product->comments);
427 428 ?>
... ...
frontend/views/catalog/products.php
... ... @@ -81,16 +81,14 @@
81 81  
82 82  
83 83 </div>
84   - <div class="block-75" itemscope itemtype="http://schema.org/Product">
85   -
  84 + <div class="block-75">
86 85  
87 86 <h1 class="title"><?= Seo::widget([ 'row'=>'h1'])?></h1>
88 87  
89   -
90 88 <div class="list_filters_links">
91 89  
92   -
93 90 <div class="sort_block">
  91 +
94 92 <span>Сортировка:</span>
95 93 <?= \yii\widgets\LinkSorter::widget([
96 94 'sort' => $productProvider->sort,
... ...
frontend/views/layouts/main.php
... ... @@ -126,11 +126,11 @@ use common\models\Event;
126 126 </div>
127 127 <div class="clearfix"></div>
128 128 <header>
129   - <div class="container">
  129 + <div class="container" itemscope itemtype="http://schema.org/Organization">
130 130 <table cellpadding="0" cellspacing="0" border="0" class="header_tb">
131 131 <tr>
132 132 <td valign="middle" class="col-md-2 col-lg-3">
133   - <a href="/"><img class="header-new-img" src="/images/new_img/new_logo.png" alt=""></a>
  133 + <a href="/" itemprop="url"><img class="header-new-img" itemprop="logo" src="/images/new_img/new_logo.png" alt=""></a>
134 134 </td>
135 135 <td align="center" valign="middle" class="col-md-4 col-lg-4">
136 136 <table class="tb_phones" cellspacing="0" cellpadding="0" border="0">
... ... @@ -141,7 +141,7 @@ use common\models\Event;
141 141 <td>
142 142 <img src="/images/new_img/ico/ico-7.png" alt="">
143 143 </td>
144   - <td><p class="header_phones">
  144 + <td><p class="header_phones" itemprop="telephone">
145 145 <span>(044)</span> 339-92-33</p></td>
146 146 </tr>
147 147 </table>
... ... @@ -152,7 +152,7 @@ use common\models\Event;
152 152 <td>
153 153 <img src="/images/new_img/ico/ico-9.png" alt="">
154 154 </td>
155   - <td><p class="header_phones">
  155 + <td><p class="header_phones" itemprop="telephone">
156 156 <span>(095)</span> 282-85-08</p></td>
157 157 </tr>
158 158 </table>
... ... @@ -166,7 +166,7 @@ use common\models\Event;
166 166 <td>
167 167 <img src="/images/new_img/ico/ico-8.png" alt="">
168 168 </td>
169   - <td><p class="header_phones">
  169 + <td><p class="header_phones" itemprop="telephone">
170 170 <span>(068)</span> 776-60-67</p></td>
171 171 </tr>
172 172 </table>
... ... @@ -229,16 +229,28 @@ use common\models\Event;
229 229 <div class="container">
230 230  
231 231 <!---test--->
232   - <?= Breadcrumbs::widget([
233   - 'homeLink' => [
234   - 'label' => 'Интернет-магазин светильников',
235   - 'url' => Url::to([ '/' ]),
236   - 'itemprop' => 'url',
237   - ],
238   - 'itemTemplate' => "<li><span itemprop=\"title\">{link}</span></li>\n",
239   - // template for all links
240   - 'links' => isset( $this->params[ 'breadcrumbs' ] ) ? $this->params[ 'breadcrumbs' ] : [],
241   - ]) ?>
  232 + <?php
  233 + if (isset($this->params['breadcrumbs'])) {
  234 + $links = $this->params['breadcrumbs'];
  235 + foreach($links as $index => $link) {
  236 + if(is_array($link)) {
  237 + $links[$index]['itemprop'] = 'url';
  238 + $links[$index]['label'] = '<span itemprop="title">'.$links[$index]['label'].'</span>';
  239 + }
  240 + }
  241 + }
  242 + echo Breadcrumbs::widget([
  243 + 'encodeLabels' => false,
  244 + 'itemTemplate' => "<li><span itemscope itemtype=\"http://data-vocabulary.org/Breadcrumb\">{link}</span></li>\n",
  245 + 'links' => isset($links) ? $links : [],
  246 + 'homeLink' => [
  247 + 'label' => '<span itemprop="title">Интернет-магазин светильников</span>',
  248 + 'url' => Url::to([ '/' ]),
  249 + 'itemprop' => 'url',
  250 + ],
  251 + 'activeItemTemplate' => '<li class="active"><span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">{link}</span></span></li>',
  252 + ])
  253 + ?>
242 254  
243 255  
244 256 </div>
... ... @@ -340,7 +352,7 @@ use common\models\Event;
340 352 <footer>
341 353 <div class="container margin-top-40">
342 354 <div class="row">
343   - <div class="col-md-3 col-lg-3">
  355 + <div class="col-md-3 col-lg-3" itemscope itemtype="http://schema.org/Organization">
344 356 <div class="footer-title_new">Есть к нам вопросы?</div>
345 357 <table class="footer-phones-wr" cellspacing="0" cellpadding="0" border="0" width="100%">
346 358 <tr>
... ... @@ -349,7 +361,7 @@ use common\models\Event;
349 361 <tr>
350 362 <td><img src="/images/new_img/ico/ico-7.png" alt="">
351 363 </td>
352   - <td><p class="footer_phones">
  364 + <td><p class="footer_phones" itemprop="telephone">
353 365 <span>(044)</span> 339-92-33</p></td>
354 366 </tr>
355 367 </table>
... ... @@ -361,7 +373,7 @@ use common\models\Event;
361 373 <tr>
362 374 <td><img src="/images/new_img/ico/ico-8.png" alt="">
363 375 </td>
364   - <td><p class="footer_phones">
  376 + <td><p class="footer_phones" itemprop="telephone">
365 377 <span>(068)</span> 776-60-67</p></td>
366 378 </tr>
367 379 </table>
... ... @@ -373,7 +385,7 @@ use common\models\Event;
373 385 <tr>
374 386 <td><img src="/images/new_img/ico/ico-9.png" alt="">
375 387 </td>
376   - <td><p class="footer_phones">
  388 + <td><p class="footer_phones" itemprop="telephone">
377 389 <span>(095)</span> 282-85-08</p></td>
378 390 </tr>
379 391 </table>
... ...