4.2 1 1 1 1 1 1 1 1 1 1 Rating 4.20 (5 Votes)

1. Открываем шаблон товара - /components/com_jshopping/templates/default/product/product_default.php
и оборачиваем весь код вот в такой див:

<div itemscope itemtype="http://schema.org/Product"></div>

там же ищем заголовок продукта (обозначен тегами <h1></h1>)


Заголовок оборачиваем в:

<span itemprop="name"></span>

2. Открываем шаблон рейтинга - /components/com_jshopping/templates/default/product/ratingandhits.php
оборачиваем в див:

<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"></div>


внутрь слоя добавляем код:

<span itemprop="ratingValue">product->average_rating;?></span>
<span itemprop="bestRating">10</span>
<span itemprop="reviewCount">product->reviews_count;?></span>

У меня получилось вот так:

<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<?php defined('_JEXEC') or die(); ?>
<?php if ($this->allow_review || $this->config->show_hits){?>
<div style="height:22px;">
<table align="right">
  <?php if ($this->config->show_hits){?>
  <td><?php print _JSHOP_HITS?>: </td>
  <td><?php print $this->product->hits;?></td>
  <?php } ?>
  <?php if ($this->allow_review && $this->config->show_hits){?>
  <td> | </td>
  <?php } ?>
  <?php if ($this->allow_review){?>
  <td><?php print _JSHOP_RATING?>: </td>
  <?php print showMarkStar($this->product->average_rating);?>  

<div class="microrazmetca">
<span itemprop="ratingValue"><?php print $this->product->average_rating;?></span> из  
<span itemprop="bestRating">10</span>
<span itemprop="reviewCount"><?php print $this->product->reviews_count;?></span>
  <?php } ?>
<?php } ?>

Проверяем http://www.google.com/webmasters/tools/richsnippets

Сказать спасибо лучше кнопками:


0 #2 Shelli 18.02.2018 23:19
Just want to say your article is as astounding. The clearness on your submit
is just great and i can think you are an expert on this subject.
Well with your permission allow me to take hold of your RSS feed to keep updated
with imminent post. Thanks 1,000,000 and please carry on the enjoyable work.

Visit my web site - canadian pharmacy: http://canadianpharmacyntx.com/
0 #1 Lyn 18.02.2018 08:33
Currently it sounds like Wordpress is the best blogging platform out there right now.
(from what I've read) Is that what you're using on your blog?

Also visit my blog post - canadapharmacy: http://canadianpharmacyntx.com/

Добавить комментарий

Защитный код

Новые материалы
Последнии Комментарии