Jump to content

Google "Rich Snippets"


Recommended Posts

I have been working through bumping up my googleness and found that google wasnt really displaying my products like I wanted since the template I use isnt real google friendly for general organic searches.

 

I noticed some sites had the prices and other things right in the listing and then ran across Rich Snippets which basically tells google the basic product information which they then display in a much more pleasant way.

 

Here is the how-to link at google help.. notice the search listing image at the top..yea..thats the stuff.

https://support.goog...n&answer=146750

 

So basically you take your theme/product.tpl and insert the google special sauce within the tags.

 

You start by wrapping the whole product info area with a special div..like this..

<div itemscope itemtype="http://data-vocabulary.org/Product">

..all your product info

yada

yada

yada

</div>

 

Then, you dig around for the info you want to include like the product name, price, description, image, etc.. and **insert** some tags so google can read it..like this..

<h1>{$product->name|escape:'htmlall':'UTF-8'}</h1>

becomes

<h1 itemprop="name">{$product->name|escape:'htmlall':'UTF-8'}</h1>

 

So you make your way down the product.tpl inserting the specific tags inside your divs and spans or any tag apparently since the H1 worked for me as well.

 

Once you get it the way you want, you can test it in their spiffy little tool by doing a view source and pasting the whole mess here..

http://www.google.co...ls/richsnippets

 

And it will show you what your markup will look like in a search listing.

 

It wont show up immediately as they will have to re-crawl you first, but once it does, you should have some much prettier search listings.

 

 

And now..you know :)

 

SC

  • Like 2
Link to comment
Share on other sites

@ RalfP

 

I think it is going to be different for different themes. I use a heavily moified clothestheme I found online. I think the key is to make sure you wrap your entire content area and make sure to put the closing </div> and be careful not to put either within an if statement that might not process. Do a force compile and do a view source to make sure the changes are there. If not, you might need to clear your PrestaShop cache files.

 

For what its worth.. here is my lines 121-124 where I start the markup

 

{include file="$tpl_dir./breadcrumb.tpl"}
<div itemscope itemtype="http://data-vocabulary.org/Product">
<div id="primary_block" class="clearfix">
   <h1 itemprop="name">{$product->name|escape:'htmlall':'UTF-8'}</h1>

 

And I put the closing </div> at the very end of the file.

 

Good luck :)

SC

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

For what its worth.. here is my lines 121-124 where I start the markup

 

{include file="$tpl_dir./breadcrumb.tpl"}
<div itemscope itemtype="http://data-vocabulary.org/Product">
<div id="primary_block" class="clearfix">
<h1 itemprop="name">{$product->name|escape:'htmlall':'UTF-8'}</h1>

 

And I put the closing </div> at the very end of the file.

 

Good luck :)

SC

 

I added the itemProp attribute to my 'primary_block' div, and it seems to work as well:

 

<div id="primary_block" class="clearfix" itemscope itemtype="http://data-vocabulary.org/Product">

Link to comment
Share on other sites

  • 2 weeks later...

 

Excelent guide, I tried add product image for display in rich snippet tool but this don´t work. I put product image code in product.tpl as:

<img itemprop="image" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')}" {if="" $jqzoomenabled}class="jqzoom" alt="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')}" {else}="" title="{$product->name|escape:'htmlall':'UTF-8'}" {="" if}="" id="bigpic" width="{$largeSize.width}" height="{$largeSize.height}">

 

Perhaps it don´t work because I have a module of productrating with other google rich code and creates conflict with the two codes?

 

i have on other module this code:

<span class="hreview-aggregate" style="display: none !important;">
 <span class="item">
  <span class="fn">{$product->name}</span>
 </span>,
 <span class="rating">
  <span class="average">{$allratings}</span> out of
  <span class="best">{$maxunit}</span> based on
  <span class="votes">{$votes}</span> ratings
  <span class="summary"></span>
 </span>
</span>

 

best regards

Link to comment
Share on other sites

Do you have a link to your site. It would be easier to test out that way and see what might be wrong.

Hi Dh42

I attach google rich tool with link of product preview:

http://www.google.co...3Dproduct&html=

 

and product url is:

http://../index.php?id_product=1&controller=product

 

This is my site test, don´t is final web

thanks very much

Edited by seog (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...