Jump to content
thirty bees forum

Pricing displayed as x,xx triggers an error for rich results


netamismb

Recommended Posts

I am using Niara theme and I have an issue with how the price is displayed. On the home page and products in the same category, the price is displayed with a comma for example 12,9 Eur. On the product page, the price is displayed with a dot 12.9. 

Is it possible to have the price displayed everywhere with a dot? The issue with having the price displayed with a comma triggers an error for rich results:  Invalid floating point number in property 'price'. 

Link to comment
Share on other sites

In Niara theme, on product-list-item.tp I have:
<span class="price product-price" itemprop="price" content="{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}"><>{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} 

<meta itemprop="priceCurrency" content="{$currency->iso_code}">

</span>
 
But this line will show:
                <span class="price product-price" itemprop="price" content="12,90 €">
              12,90 €                <meta itemprop="priceCurrency" content="EUR"></span>
                                
 
And correct will be (I believe):
<span class="price product-price" itemprop="price" content="12.90">
              12,90 €                <meta itemprop="priceCurrency" content="EUR"></span>
 
Any idea how can I achieve this?

 

Edited by netamismb
Link to comment
Share on other sites

{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}

replace with simple

{$product.price}

On a related note -- I strongly recommend to remove all rich snippets markup metadata from this file.

Imagine you have product page that shows 9 related products in the footer. When google parses this page, it sees that this page contains information about 10 products. Which is not true - the page contains one product, and 9 links to related products.  

Similarly, when google index your category page, it sees that this is page that contains 12 products. Again, that's not true. It is category listing page with links to 12 products.

Having product metadata in product miniature blocks creates unnecessary noise which can confuse search engines. Just get rid of them, and google will be able to better index your pages.

Link to comment
Share on other sites

Thank you @datakick, I believe you are correct.
I removed all rich snippets markup metadata from this file, including itemscope itemtype="https://schema.org/Product"  from <div class="product-container" itemscope itemtype="https://schema.org/Product">. And now I don't have any critical issues when testing rich results.

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...