Jump to content

[FREE TUTORIAL] Add Google Rich Snippets to your Prestashop store


Recommended Posts

Hey everybody!

 

I just finished writing this little guide on adding Google rich snippets to Prestashop, I hope iyou can find it useful!

 

http://nemops.com/prestashop-google-rich-snippets/

 

And, by the way, using this guide you'll end up having the correct price shown in the rich snippet, since currency and price have to be separated for Google.

 

Cheers!

 

Fabio

  • Like 13
Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...
  • 2 months later...

Thanks for the guide - I'm just following it all through now.

 

One problem I have come up is that when I am testing the rich snippets using the Google tool I get the following error:

 

Warning: Missing required field "name (fn)".

Warning: Incomplete microdata with schema.org.

 

Any clue as to what I have done wrong?!?

 

Thanks,

Nick

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

  • 4 weeks later...
  • 4 weeks later...

Thanks for sharing. Unfortunately in my case, the result was this one.

 

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/public_html/themes/default/product.tpl" on line 189 "<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" height="{$largeSize.height}" width="{$largeSize.width}">" - Unexpected "=", expected one of: "}" , " " , ATTR' in /public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:665 Stack trace: #0 /home/ in /public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 665

 

What am I doing wrong? I'll try to use the original version until I'll find out. Thank you.

Link to comment
Share on other sites

  • 2 weeks later...

Hi there,

thank you very much for this tutorial. I've got 2 questions about it.

 

1. after implementing the changes the price on the product page displays like 99 PLN while before the changes it was 99,00 PLN and i preffer it like that. When the price is 99,90 it displays 99.9 which is annoying.

 

2. I don't use short description in my shop so I've decided to use the long one.

<!-- full description -->
 <div id="idTab1" class="rte" itemprop="description">{$product->description}</div>

But google doesn't see my description.

 

I would appreciate your help with it.

 

Thanks in advance.

Link to comment
Share on other sites

Thanks for sharing. Unfortunately in my case, the result was this one.

 

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/public_html/themes/default/product.tpl" on line 189 "&lt;img itemprop=&quot;image&quot; src=&quot;{$link-&gt;getImageLink($product-&gt;link_rewrite, $cover.id_image, 'large_default')}&quot; {if=&quot;&quot; $jqzoomenabled}class=&quot;jqzoom&quot; alt=&quot;{$link-&gt;getImageLink($product-&gt;link_rewrite, $cover.id_image, 'thickbox_default')}&quot; {else}=&quot;&quot; title=&quot;{$product-&gt;name|escape:'htmlall':'UTF-8'}&quot; {=&quot;&quot; if}=&quot;&quot; id=&quot;bigpic&quot; height=&quot;{$largeSize.height}&quot; width=&quot;{$largeSize.width}&quot;&gt;" - Unexpected "=", expected one of: "}" , " " , ATTR' in /public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:665 Stack trace: #0 /home/ in /public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 665

 

What am I doing wrong? I'll try to use the original version until I'll find out. Thank you.

 

Hi,

There is a typo in the tpl file, at about where the main image is shown

 

Hi there,

thank you very much for this tutorial. I've got 2 questions about it.

 

1. after implementing the changes the price on the product page displays like 99 PLN while before the changes it was 99,00 PLN and i preffer it like that. When the price is 99,90 it displays 99.9 which is annoying.

 

2. I don't use short description in my shop so I've decided to use the long one.

<!-- full description -->
 <div id="idTab1" class="rte" itemprop="description">{$product->description}</div>

But google doesn't see my description.

 

I would appreciate your help with it.

 

Thanks in advance.

 

 

My fault, you should always use the assigned variable 'rightPrice' where I wrote productPrice (correcting it right away). As for the description, I don't really know :/

Link to comment
Share on other sites

My fault, you should always use the assigned variable 'rightPrice' where I wrote productPrice (correcting it right away). As for the description, I don't really know :/

 

Now it works like a charm, thank you! But I stil can't get description ;/ One more question - why in the google webmasters tools under the structural data I got this message that they didn't find structural data on my webpage while in the testing tool everything seems to be working?

Link to comment
Share on other sites

  • 5 weeks later...

Now it works like a charm, thank you! But I stil can't get description ;/ One more question - why in the google webmasters tools under the structural data I got this message that they didn't find structural data on my webpage while in the testing tool everything seems to be working?

 

You will see the changes in Google Webmaster Tools after two or three weeks, even more. Is my experience.

Link to comment
Share on other sites

Thanks for the guide - I'm just following it all through now.

 

One problem I have come up is that when I am testing the rich snippets using the Google tool I get the following error:

 

Warning: Missing required field "name (fn)".

Warning: Incomplete microdata with schema.org.

 

Any clue as to what I have done wrong?!?

 

Thanks,

Nick

 

You have to add the itemptype before the itemprop, so you have to create a div like this instead of add it in <div id="primary_block"... , you can close the div at the end of product.tpl

 

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

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

<div id="primary_block" class="clearfix">

 

I couldn't add the description itemprop, any solution?

Link to comment
Share on other sites

Now it works like a charm, thank you! But I stil can't get description ;/ One more question - why in the google webmasters tools under the structural data I got this message that they didn't find structural data on my webpage while in the testing tool everything seems to be working?

 

I already fix the description problem, I added it here:

 

<div itemprop="description" id="idTab1" class="rte">{$product->description}</div>

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hi,

 

Thank you for the tutorial , but i run into a problem ,can you help me to fix this ?

 

I got everything right except google rich snippets testing tool not showing my price or the product image (attached image)

 

prestashop version 1.5.4.1, i rechecked all the codes but can't understand what went wrong (my product.tpl txt file attached with this post)

 

Thank you for your help in advance.

 

 

Google_Structured_Data_Testing_Tool.png

product tpl txt.txt

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

Hi,

 

Thank you for the tutorial , but i run into a problem ,can you help me to fix this ?

 

I got everything right except google rich snippets testing tool not showing my price or the product image (attached image)

 

prestashop version 1.5.4.1, i rechecked all the codes but can't understand what went wrong (my product.tpl txt file attached with this post)

 

Thank you for your help in advance.

 

 

Google_Structured_Data_Testing_Tool.png

I have looked into your code and found that you haven't added snippet for price.

 

Remove all changes that you have done in product.tpl file and then add these code snippet in product.tpl file,

<div itemscope itemtype="http://schema.org/Product" style="display: none;">
	<span itemprop="name">{$product->name|escape:'htmlall':'UTF-8'}</span>
	<span itemprop="description">{$meta_description}</span>
	<img itemprop="image" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large')}"/>
	<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
	<span itemprop="price">{convertPrice price=$productPrice}</span>
</div>
 

right before this line,

{if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}

and check it after adding code.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Hello,

 

Everything works fine, but i have issue with product reference. If product has combination then product reference is not showing.

Looks like here is problem with javascript product.js . If I'm using not modified product.js, product reference is visible, but then i have double currency sign issue. 

My product.js code looks like this:

 

//productPrice = ps_round(productPrice * currencyRate, 2);
if (productPrice > 0)
var re = new RegExp("\\"+currencySign, "g");
        var signRemoved = our_price.replace(re, "");
 
$('#our_price_display').text(signRemoved);
else
$('#our_price_display').text(formatCurrency(0, currencyFormat, currencySign, currencyBlank));
 
$('#old_price_display').text(formatCurrency(productPriceWithoutReduction, currencyFormat, currencySign, currencyBlank));
 
Can somebody help me? Interesting thing, then product reference is not showing i can see it in page source :(
 
Thank you in advance!
Link to comment
Share on other sites

 

Hello,

 

Everything works fine, but i have issue with product reference. If product has combination then product reference is not showing.

Looks like here is problem with javascript product.js . If I'm using not modified product.js, product reference is visible, but then i have double currency sign issue. 

My product.js code looks like this:

 

//productPrice = ps_round(productPrice * currencyRate, 2);
if (productPrice > 0)
var re = new RegExp("\\"+currencySign, "g");
        var signRemoved = our_price.replace(re, "");
 
$('#our_price_display').text(signRemoved);
else
$('#our_price_display').text(formatCurrency(0, currencyFormat, currencySign, currencyBlank));
 
$('#old_price_display').text(formatCurrency(productPriceWithoutReduction, currencyFormat, currencySign, currencyBlank));
 
Can somebody help me? Interesting thing, then product reference is not showing i can see it in page source :(
 
Thank you in advance!

 

 

Can i have your product page link please??

Link to comment
Share on other sites

  • 3 weeks later...

Thanks for this useful post!

 

You can add the availability (/theme/mytheme/product.tpl page) within : itemprop="offers", just after price & currency :

<p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
[... price & currency ...]
{if $product->quantity <= 0}
<link itemprop="availability" href="http://schema.org/OutOfStock"></link>
{else}<link itemprop="availability" href="http://schema.org/InStock"></link>{/if}
[...]
</p>

 

And to have categories (breadcrumb) too, you need to edit /themes/mytheme/breadcrumb.tpl and override Tools.php :

<!-- Breadcrumb -->
{if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if}
<section class="breadcrumb" id="breadcrumb" itemprop="breadcrumb" >
    <div itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
        <a href="{$base_dir}" title="{l s='return to Home'}" itemprop="url">
            <span itemprop="title">{l s='Home'}</span></a>
    </div>
{if isset($path) AND $path}
    <span class="navigation-pipe" {if isset($category) && $category->id_category == 1}style="display:none;"{/if}>{$navigationPipe|escape:html:'UTF-8'}</span>
    
    {if !$path|strpos:'span'}
        <span class="navigation_page">{$path}</span>
    {else}
        {$path}
    {/if}
{/if}

{if !isset($product) && isset($category)}  {include file="$tpl_dir./category-count.tpl"}{/if}
</section>
<!-- /Breadcrumb -->

/override/classes/Tools.php :

function line 858 and modified code line 893

public static function getPath(...){
[...]
foreach ($categories as $category)
{
$full_path .= (($n < $n_categories || $link_on_the_item) ? '<div itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">'
.'<a itemprop="url" href="'.Tools::safeOutput($context->link->getCategoryLink((int)$category['id_category'], $category['link_rewrite'])).'" title="'.htmlentities($category['name'], ENT_NOQUOTES, 'UTF-8').'">' : '')
.'<span itemprop="title">'.htmlentities($category['name'], ENT_NOQUOTES, 'UTF-8').'</span>'
.(($n < $n_categories || $link_on_the_item) ? '</a>' : '')
.(($n++ !== $n_categories) ? '<span class="navigation-pipe">'.$pipe.'</span></div>' : '');
}
return ...
[...]
 

 

You can mark more images too adding itemprop="image" into thumbs links in the foreach.
 

And for customers reviews, I suggest Yotpo which provides a free rich snippets based module.

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

  • 2 months later...
hello i get this error when i run the google tool
 
Item 

type: http://schema.org/product property:   image: http://tranzistor.bg/95-large_default/led-lenta-smd5050-60led-m-144w-m-12vdc-vlagozashhitena-rgb.jpg name: LED лента SMD5050, 60led/m, 14.4W/m, 12VDC, влагозащитена, RGB description: Гъвкава RGB LED лента с 60 светодиода на метър и водоустойчиво силиконово покритие. Намира приложение за декора... offers:

Item 1
Грешка(error): Incomplete microdata with schema.org.
SOLVED
But i have another problem. When I add url to the google testing tool it doesnt show the img. 
the image url is showing in the item tab
Item 
type: http://schema.org/product property:   image: http://tranzistor.bg/1-large_default/invertor-12-vdc-220-vac-150-w-usb-a301-150n-12.jpg name: Инвертор 12 VDC - 220 VAC 150 W + USB A301-150N-12 description: Инверторен преобразувател на напрежение 12 VDC - 220 VAC с модифицирана синусоида и изходна мощност 100 W, 150 W (300... offers:
Item 1
Edited by skochobahn (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

And it doesn't work for 1.4.6.2 because product.js code is different:


		//productPrice = ps_round(productPrice * currencyRate, 2);
		if (productPrice > 0)
		
			$('#our_price_display').text(formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank));
		else
			$('#our_price_display').text(formatCurrency(0, currencyFormat, currencySign, currencyBlank));

I've tried to edit this code adding the new var "signRemoved" but with no success.

 

 

[sOLVED]

 

 

I solved in this way:

//productPrice = ps_round(productPrice * currencyRate, 2);
		if (productPrice > 0)
		
			$('#our_price_display').text(formatCurrency(productPrice, currencySign, currencyBlank));
		else
			$('#our_price_display').text(formatCurrency(0, currencySign, currencyBlank));

Thanks very much to Nemo1 

Edited by Carisma (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 4 months later...
 

Hi,

 

As you explained in this post, I´ve placed these lines in product.tpl file just before the line you indicated:

 

<div itemscope itemtype="http://schema.org/Product" style="display: none;">

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

<span itemprop="description">{$meta_description}</span>

<img itemprop="image" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large')}"/>

<span itemprop="brand" itemscope itemtype="http://schema.org/Organization"> <span itemprop="name">{$product->manufacturer_name}</span></span>

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">

<span itemprop="price">{convertPrice price=$productPrice}</span>

</div>

 

And features header for every product page has been moved to the top of the page, just over the product name, hiding it.

 

I´ve deleted these lines and everything is working fine again.

 

Prestashop 1.6.0.6

 

I´ve attached prouct.tpl modified.

 

Do you know what could it happen?

 

Thanks in avance.

 

 

product.zip

Link to comment
Share on other sites

  • 1 month later...

I'm testing rich snippets im my store with this module, and when i testing on google I see one issue. in my store I have 3 currencies, Eur GBP and PLN, Default store currency is EURO. Price should be displayed in customer currency?? Geoip localization is active.
price is displayed only in default currency?? or depend of customer ip localization??
Or this issue in only on google test page??

 

My presta 1.6.0.9. default boostrap

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

  • 2 weeks later...

Hi Foris,

I think I have a problem with rich snippets, I can not solve alone. :( At the webmaster tools display on google there are 2127 elements and 1638 errors by rich snippets. The error message say that no price is passed. But the prices are marked in code. I attached a screenshoot. My Prestashop-Version is 1.6.0.9 and the theme grounds of the default-bootstrap-theme. Can anyone help me to fix the error.

Regards

Link to comment
Share on other sites

Hi Nemo,

thanks for your interesst. :) I read your tutorial but I don't understood everything. But now there is a light on me ;) .

The default-bootstrap-theme got the following code for the price item:

<p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
{if $priceDisplay >= 0 && $priceDisplay <= 2}
<span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</span>

You wrote: This is not correct. The right code is:

<p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{$rightPrice = {convertPrice price=$productPrice[spam-filter]
{if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
{if $priceDisplay >= 0 && $priceDisplay <= 2}
{if $currencyFormat == 1 || $currencyFormat == 3}
{$currencySign} <span id="our_price_display" itemprop="price">{$rightPrice|regex_replace:"/[\\{$currencySign}]/":""}</span>
{else}
<span id="our_price_display" itemprop="price">{$rightPrice|regex_replace:"/[\\{$currencySign}]/":""}</span> {$currencySign}
{/if}

I changed the original prestashop code according your great tutorial an I hope it works now.

great work and regards

Edited by Luca01 (see edit history)
  • Like 1
Link to comment
Share on other sites

Hi Nemo,

I changed two codes to solve the problem. First code in the product.tpl:

Old code

<p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
{if $priceDisplay >= 0 && $priceDisplay <= 2}
<span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</span>

New code in order to the tutorial:

<p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{$rightPrice = {convertPrice price=$productPrice[spam-filter]
{if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
{if $priceDisplay >= 0 && $priceDisplay <= 2}
{if $currencyFormat == 1 || $currencyFormat == 3}
{$currencySign} <span id="our_price_display" itemprop="price">{$rightPrice|regex_replace:"/[\\{$currencySign}]/":""}</span>
{else}
<span id="our_price_display" itemprop="price">{$rightPrice|regex_replace:"/[\\{$currencySign}]/":""}</span> {$currencySign}
{/if}

The second code in product-list.tpl.

Old code:

<div class="content_price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
<span itemprop="price" class="price product-price">
{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
</span>
<meta itemprop="priceCurrency" content="{$currency->iso_code}" />

The new code was a little tricky cause the variable names where different to the first code in product.tpl. So it looks:

<div class="content_price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{$rightPrice = {convertPrice price=$product.price[spam-filter]
{$rightPricetaxexc = {convertPrice price=$product.price_tax_exc[spam-filter]
{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
{if $currencyFormat == 1 || $currencyFormat == 3}
<span class="price product-price">{$currency->sign}</span>
<span itemprop="price" class="price product-price">
{if !$priceDisplay}{$rightPrice|regex_replace:"/[\\{$currency->sign}]/":""}{else}{$rightPricetaxexc|regex_replace:"/[\\{$currency->sign}]/":""}{/if}
</span>
{else}
<span itemprop="price" class="price product-price">
{if !$priceDisplay}{$rightPrice|regex_replace:"/[\\{$currency->sign}]/":""}{else}{$rightPricetaxexc|regex_replace:"/[\\{$currency->sign}]/":""}{/if}
</span>
<span class="price product-price">{$currency->sign}</span>
 {/if}
<meta itemprop="priceCurrency" content="{$currency->iso_code}" />

Now I tested it by using the structured data testing tool and I think it works. :) I add a screenshoot of the product.tpl test namend "screen1" in this post.

 

In the same way I tested the structured data of the product-list.tpl. It seems there's a problem in the structured data. :mellow: There are incomplete microdata. I add a screenshoot of the product-list.tpl test namend "screen2" in this post too.

 

 

Regards

Edited by Luca01 (see edit history)
  • Like 1
Link to comment
Share on other sites

Hi,

I think I solved the second problem too. :D

 

There are incomplete microdata.

Google crawled my side and in prodict-list.tpl there ist a problem where google can't read the itemprop in the right way. I read skotchobahn solved this, but he wrote no way how :wacko: . So I hope this is the right way:

I changed this code:

<span itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="availability">

to this:

<span itemscope itemtype="http://schema.org/Offer" class="availability">

Because the itemprop is "availability" an not the itemprop "offers". Now every item got it's price and there is no error in the test. :)

I hope it works now.

  • Like 3
Link to comment
Share on other sites

I guess google takes the default one, or if you use geo IP the one that's bound to it

After few weeks my structured data was found by google :), and Price is displayed in default store currency(Euro),

When I testing rich snippets on the web site, price in converted for customer currency, but for google search result is only Default store currency. ( i checked for other country ip where defoult is other currency then Euro,

This is Google issue or prestashop?? Will be great if customer can see price in his currency.

And one more Question is it possible to hide In Stock ?? I don't need this info in my store.

Link to comment
Share on other sites

  • 5 weeks later...

Hi,

I think I solved the second problem too. :D

Google crawled my side and in prodict-list.tpl there ist a problem where google can't read the itemprop in the right way. I read skotchobahn solved this, but he wrote no way how :wacko: . So I hope this is the right way:

I changed this code:

<span itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="availability">

to this:

<span itemscope itemtype="http://schema.org/Offer" class="availability">

Because the itemprop is "availability" an not the itemprop "offers". Now every item got it's price and there is no error in the test. :)

I hope it works now.

 

Hello,

 

I have Error: Incomplete microdata with schema.org. only in CATEGORY page.

I get this error in Products item section.
Meanwile, product page doesn't have this error - ir is fully ok.
I fought with it a lot of time. But have no success.
I need your help, please.
 
I have some different code than you. Little modifications in some parts of default theme. 
 
 
Roy
Link to comment
Share on other sites

Hi Nemo1,

 

I carefully followed your tuto : http://nemops.com/prestashop-google-rich-snippets/#.VHWM1IuG8tU

 

It works like a charm.

When I check an url with the Google tool (http://www.google.com/webmasters/tools/richsnippets) every expected data is listed.

 

 

 

But, when I check the same url on the Bing webmaster tool, the hreview-aggregate data is not listed.

 

Would you have an idea in order to make Bing taking into account such data (coming from the Prestashop comment module) ?

 

Thank you in advance for any reply.

 

Patrick

Link to comment
Share on other sites

@Royvelvet: google doesn't exactly support product lists

@Patrick: what markup are you using for reviews? I never tested with Bing honestly :(

 

Thanks for the answer, Nemo. 

Maybe so, but I know that some people reached no errors on category page. 

All my items has price (except rating) and page of this products have no errors. They have validated schema/product.

Link to comment
Share on other sites

Well but no errors doesn't mean google will display it :) It clearly states it's not supporting schemas for product lists at the moment, so I don't think it's a big deal really (my tut does nothing to lists anyway, errors must come from somewhere else)

Link to comment
Share on other sites

  • 3 months later...

Buenos dias. He instalado tu modulo pero no veo ningun cambio en mi pagina web, es decir. No veo las calificaciones para mis productos y tampoco las ventajas de "Breadcumbs" Estare haciendo algo mal? Mi web es: www.frambuesajoyas.com

 

Muchas gracias

Link to comment
Share on other sites

Hi,

I am trying to enable the searchbox for google as per this page ( https://developers.google.com/structured-data/slsb-overview )

 

When entering this line

 

(<meta itemprop="target" content="https://query.example.com/search?q={search_term_string}"/>)

 

I am getting a white page.

 

I think its to do with the curly brackets ?

If I remove the curly brackets the site loads again, but presumably google wants these there.

 

Any ideas

 

Thanks in advance

Link to comment
Share on other sites

Hi Nemo, I know that lol.

 

I just copy/pasted the example from their site.

 

The code I tried on our site was

 

http://www.no-match.co.uk/search?controller=search&orderby=position&orderway=desc&search_query={search_query}&submit_search=

 

Its only a meta tag and doesnt run the script, but just returns a white screen when loading any page with that meta tag on it

( I dont need to do a search to show the white screen

 

I have just added the same code but put the $ in the curly brackets for the variable and it doesnt show the white screen anymore.

ie. <meta itemprop="target" content="http://www.no-match.co.uk/search?controller=search&orderby=position&orderway=desc&search_query={$search_query}&submit_search="/>

 

( I didnt try that before as google didnt say to use one )

 

 

 

Cheers

Ray

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

Hello Nemo1,

 

Thanks for your deep tutorial. I have read it an it's amazing and very complete.

I'm decided to implement in my prestashop. I just have two questions before it:

 

- I see the tutorial is from dec2012, for Prestashop 1.5.2. Does it properly work in Prestashop 1.6.0.14? Does it properly work in Prestashop Cloud?

- What about if I have installed a purchased theme. Are the same replacements?

 

Thanks,

Link to comment
Share on other sites

Hi Nemo, I know that lol.

 

I just copy/pasted the example from their site.

 

The code I tried on our site was

 

http://www.no-match.co.uk/search?controller=search&orderby=position&orderway=desc&search_query={search_query}&submit_search=

 

Its only a meta tag and doesnt run the script, but just returns a white screen when loading any page with that meta tag on it

( I dont need to do a search to show the white screen

 

I have just added the same code but put the $ in the curly brackets for the variable and it doesnt show the white screen anymore.

ie. <meta itemprop="target" content="http://www.no-match.co.uk/search?controller=search&orderby=position&orderway=desc&search_query={$search_query}&submit_search="/>

 

( I didnt try that before as google didnt say to use one )

 

 

 

Cheers

Ray

 

Turn on error reporting, I am pretty sure it's because of this: {search_query}

It's not a valid smarty variable as it's missing the dollar sign. Apart from that, if you use it in the header it won't work, since the search query is assigned to the template in the search controller (called after hookDisplayHeader)

 

Hello Nemo1,

 

Thanks for your deep tutorial. I have read it an it's amazing and very complete.

I'm decided to implement in my prestashop. I just have two questions before it:

 

- I see the tutorial is from dec2012, for Prestashop 1.5.2. Does it properly work in Prestashop 1.6.0.14? Does it properly work in Prestashop Cloud?

- What about if I have installed a purchased theme. Are the same replacements?

 

Thanks,

 

Well they are not 100% the same, but the process is pretty much similar

Link to comment
Share on other sites

  • 2 months later...

Hey everybody!

 

I just finished writing this little guide on adding Google rich snippets to Prestashop, I hope iyou can find it useful!

 

http://nemops.com/prestashop-google-rich-snippets/

 

And, by the way, using this guide you'll end up having the correct price shown in the rich snippet, since currency and price have to be separated for Google.

 

Cheers!

 

Fabio

 

 

Hello, I want to ask you just an information.

I use the service yotpo review "premium" and I've installed your module on my site www.upremium.it
 
I want to ask if now be displayed on Google the rich snippets or if I have to take some other action.
 
let me know, sorry for my bad english :)
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
  • 1 month later...
  • 2 months later...
  • 1 month later...
  • 2 weeks later...

Well,

You would need to check your website carefully against Google as  the Google Structured  data validator tool has reported the error "incomplete microdata with schema.org" a year ago. See another thread at https://www.prestashop.com/forums/topic/372498-incomplete-microdata-with-schemaorg-error-message-with-prestashop-16/

or http://stackoverflow.com/questions/27494306/error-incomplete-microdata-with-schema-org-for-product .

 

I don't know if this has been fixed in the latest version of Prestashop.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Hey everybody!

 

I just finished writing this little guide on adding Google rich snippets to Prestashop, I hope iyou can find it useful!

 

http://nemops.com/prestashop-google-rich-snippets/

 

And, by the way, using this guide you'll end up having the correct price shown in the rich snippet, since currency and price have to be separated for Google.

 

Cheers!

 

Fabio

 

YOU ARE A BOSS, already downloading your module and test it :)

Thank you

Link to comment
Share on other sites

  • 1 year later...

Hello, 

we use you guide but we have a problem with brand and also with sku, google don't take this two 

this is our code:

<label>{l s='Manufacturer:'} </label> <span itemprop="brand" itemscope itemtype="http://schema.org/Organization"> <span itemprop="name">{$product->manufacturer_name}</span></span>
            <p class="ref-cod">{l s='Reference'}: <span class="editable" itemprop="sku">{$product->reference|escape:'htmlall':'UTF-8'}</span><br>

what's the problem ? PS: 1.5.6.1

Thanks

Link to comment
Share on other sites

  • 2 years later...

I'm trying to resolve some errors Google search console is producing for our products.

When I started looking into this, I noticed that prestashop (or the theme) already puts some data related to these snippets on the product page.

There are 2 main ones which, GTIN and Brand. Both are defined for each product, but the crawler is not picking them up.

For GTIN, we have both EAN13 and UPC defined for each product

I tried adding them with various syntaxes, but no help. I've been Googling a lot and I just can't find any definitive example what the code/directives etc could be.

  <meta property="og:type" content="product">
  <meta property="og:url" content="...">
  <meta property="og:title" content="...">
  <meta property="og:site_name" content="...">
  <meta property="og:description" content="...">
  <meta property="og:image" content="...">
  <meta property="product:pretax_price:amount" content="...">
  <meta property="product:pretax_price:currency" content="...">
  <meta property="product:price:amount" content="...">
  <meta property="product:price:currency" content="...">
  <!-- Tried lot of things such as these
  <meta property="product:gtin" content="0611138295307">
  <meta property="product:ean13" content="0611138295307">
  <meta property="product:UPC" content="0611138295307">
  <meta property="product:mpn" content="0611138295307">
  <meta property="product:brand" content="Brand name">
  -->
  <meta property="product:weight:value" content="0.400000">
  <meta property="product:weight:units" content="kg">

I've also gone through @NemoPS's tutorial, but it's quite old and not sure if I'd do more harm following that or whether it is still valid? 

Any hints how to add brand, EAN13 and/or UPC so that they are recognized by Google?

We're running on Prestashop 1.7.6.1

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...