Jump to content

schema.org price issue on NEW Arrivals product tab


ANGELO Vintage
 Share

Recommended Posts

I've verified the shema.org compliance with google structured data testing tool and the Product shown in new arrival tab in the home page have wrong price value.

 

exploring the code:

 

<span itemprop="price" class="price product-price"> 950,00 </span><meta itemprop="priceCurrency" content="EUR" />

 

The symbol is not compliance with the schema.org: http://schema.org/price

the price value must be only numeric like for example:

 

  1. "offers": {
  2.     "@type": "Offer",
  3.     "availability": "http://schema.org/InStock",
  4.     "price": "55.00",
  5.     "priceCurrency": "USD"
  6.   }

 

I've tried to find out where in the theme is possible to remove the €/USD symbol but i was not able to find a solution.

 

Ty for any help

 

Share this post


Link to post
Share on other sites

After some testing and debugging, i found a fast solution to make price compliant with google microdata testing tool and schema.org.

 

Editing the product-list.tpl

and modify the liens like:

                                    {if !$priceDisplay}
                                        {$rightPrice = {convertPrice price=$product.price|floatval[spam-filter]
                                    {else}
                                        {$rightPrice = {convertPrice price=$product.price_tax_exc|floatval[spam-filter]
                                    {/if}
                                    {$nocurrencySignPrice = {$rightPrice|regex_replace:"/[\\{$currencySign} ]/":""[spam-filter]
                                    {$finalPrice = {$nocurrencySignPrice|regex_replace:"/[\\,]/":"."[spam-filter]
                                    <meta itemprop="price" content="{$finalPrice}" />
                                    
									<span class="price product-price">
										{hook h="displayProductPriceBlock" product=$product type="before_price"}
										{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
									</span>
Edited by ANGELO Vintage (see edit history)

Share this post


Link to post
Share on other sites

  • 2 months later...

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More