Hello,
Regarding SEO optimisation, I had to add some structured data by overriding modules.
To do so, I have to get the product price in several template (product.tpl, product-list.tpl, modules...).
But for one module, bockbestsellers, the displayed price is $product.price, and when I get its value I get "[Price] €".
Original code :
<span class="price">{$product.price}</span>
First try code :
<span class="price" itemprop="price">{$product.price}</span>
And I get this in google structured data test tool :
price: 1,94 €
With the following warning : The property is not a specification of valid price.
I know from my structured data in product.tpl that I need to put away the €. I only need numbers.
So I tried something that I saw on this forum :
{assign var='priceVar' value=$product.price}
<meta itemprop="price" content="{$priceVar|replace:' €':''}"/>
But it's not working.
Does someone can help me out on this problem ? I'm quite new handling smarty Prestashop template.
Additional information :
The var_dump result of $priceVar :
string '8,48 €'
In template product and product-list I do not have the problem because it seems $productPrice is already without currency.
And if I can avoid to modify the php of the module it would be great.
Thanks.