What's the difference between these two itemprop="price" Schema markup's?

Solved
Highlighted
Excursionist
37 1 25

Hello,

 

Can anyone tell me, in terms of the following two itemprop="price" Schema markup's, what is the difference?

 

<meta itemprop="price" content="{{ product.variants.first.price | money_without_currency }}">

 

<meta itemprop="price" content="{{ product.variants.first.price | divided_by: 100.00 }}">

 

Is there any difference?

Is the 2nd one a more contemporary way of doing it?

 

I have been using the former version for a while, however I am just now building out new look using the free Shopify 'Narrative' theme which uses the latter version of the two shown above. Naturally I am interested to know why.

 

Thank you in advance.

 

 

 

 

0 Likes
Shopify Partner
482 86 127

This is an accepted solution.

they are actually output the same result, just the version with money_without currency is not trailing zeros, also it is safer to use the second method because depending on theme settings, the first version can output different result.

so, if the price of the product is $9.5 in dashboard.

the price, without any filter will be like this. 950 -  in cents.

using the money_without_currency filter it will output 9.50

Also we have another filter money_without_trailing_zeros, which will do trail zeros as wel.

https://help.shopify.com/en/themes/liquid/filters/money-filters#money_without_trailing_zeros

Using the divided_by: 100 filter it will output 9.5 - trailing the zeros.


Author: Hovhannes Sargsyan (aka sarhov).
An individual web developer focused on Shopify development.
Need more help? Feel free to send me a direct message or drop an email shopify@sarhov.com

Website: https://sarhov.com  
Email: shopify@sarhov.com
Skype: @sarhov
Telegram: @sarhov
Try Shopify free for 14 days,
1 Like