Magento : Add Schema org for product in magento

– 1°  IMPLEMENTING PRODUCT SCHEMA

-we must edit our product view.phtml ([your_theme]/template/catalog/product/view.phtml  ) to wrap our dynamic product pages in our new schema.org markup.

 

and change :

 

<div class=”product-view”>

in

<div class=”product-view” itemscope itemtype=”http://schema.org/Product”>

and

<div class=”product-name”>
<h1><?php echo $_helper->productAttribute($_product, $_product->getName(), ‘name’) ?></h1>
</div>

 

in

<div class=”product-name”>
<h1 itemprop=”name”><?php echo $_helper->productAttribute($_product, $_product->getName(), ‘name’) ?></h1>
</div>

 

and

 

<div class=”short-description”>
<h2><i class=”fa fa-book”></i> <?php echo $this->__(‘Quick Overview’) ?></h2>
<div class=”std”><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), ‘short_description’) ?></div>
</div>

 

in

 

<div class=”short-description”>
<h2><i class=”fa fa-book”></i> <?php echo $this->__(‘Quick Overview’) ?></h2>
<div class=”std” itemprop=”description”><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), ‘short_description’) ?></div>
</div>

This will wrap our view.phtml inside the “Product” item type.

Now we need to add markup to our product description and our product image.

Then we must edit our product image media.phtml ([your_theme]/template/catalog/product/view/media.phtml  )

change:

$_img = ‘<img id=”image” …

in

$_img = ‘<img itemprop=”image” id=”image” ….

 

Next we need to add our Aggregate Rating Schema.

The AggregateRating schema will only show up if there are reviews for our product and also whether our theme supports showing these reviews.