netamismb Posted September 4, 2023 Posted September 4, 2023 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'.
nickz Posted September 5, 2023 Posted September 5, 2023 (edited) How have you set your currency? Edited September 5, 2023 by nickz
netamismb Posted September 6, 2023 Author Posted September 6, 2023 Here is my settings. I chose the comma as this is the preferred format in Spain, but as it is hurting the rich results I am fine changing it.
netamismb Posted September 8, 2023 Author Posted September 8, 2023 (edited) 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 September 8, 2023 by netamismb
datakick Posted September 9, 2023 Posted September 9, 2023 {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.
netamismb Posted September 9, 2023 Author Posted September 9, 2023 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now