Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Invalid floating point number in property "price" (in "offers")

Invalid floating point number in property "price" (in "offers")

Incredible-ro
New Member
6 0 0

Hello,

 

I have a problem with my store in Google Merchant - Invalid floating point number in property "price" (in "offers")

 

The error is pointed in the print screen. Could you help me please to solve this error? Thank you

 

image.png

Replies 16 (16)

magecomp
Shopify Partner
450 31 47

This error is indicating that there is an issue with the format of the price value for your product in the Google Merchant Center. The price value should be a valid floating-point number, which means it should contain a decimal point and only digits.

 

To resolve this issue, you should check the price value for your products in your Shopify store and ensure that they are correctly formatted as floating-point numbers.

Here are some steps you can follow:

 

  1. Log in to your Shopify store and go to the Products section.

  2. Select a product that is showing the error in the Google Merchant Center.

  3. Check the price field for the product and make sure it contains only digits and a decimal point.

  4. If there are any other characters or symbols in the price field, remove them and save the changes.

  5. Repeat the same process for all products that are showing the error in the Google Merchant Center.

  6. Once you have corrected the price values for all products, wait for some time and then resubmit your product feed to the Google Merchant Center.

  7. The error should be resolved, and your products should be approved for listing in the Google Merchant Center.

 

If you continue to experience issues, you can reach out to Shopify support or the Google Merchant Center support team for further assistance.

Helping voluntarily. Please like and accept the solution if it helps. Thanks!
Our Bestseller Shopify Apps    |      Mobile App Builder by MageComp    |      Shoplock Hide Pages/Collections

Need a developer?  Just visit MageComp website
Incredible-ro
New Member
6 0 0

Hello and thank you for your answer,

 

Everywhere I have prices like this one 355.00 so no decimals after .

 

The error is at all products said Google

EmmanuelFlossie
Shopify Partner
3460 264 834

Move your currency outside of the itemprop price. Only include digits.

Simply create another span element outside of the itemprop and add your currency there.

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
Bushy
Visitor
2 0 1

For someone thats not very literate with changing code, can you give another example of how to do this please?
Like how to create another span element in shopify? 

EmmanuelFlossie
Shopify Partner
3460 264 834

Each theme is different, and even with the same theme, each theme will be customized as well. Making a step by step guide near impossible. What is the correct answer for you will not be the same for someone else. So if you want guidance, please share specific details so that I can provide an answer.

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
Scott-JBW
Visitor
2 0 0

Hi 

I was interested to read your reply in response to those experiencing this issue which is now an error being raised by Google in our website. Google Search Console is highlighting the following:
<meta itemprop="priceCurrency" content="GBP">
<meta itemprop="price" content="&pound;2,799.00"> 

It is the second line of content it has shaded in red. I see a comma between the 2 and 7. 

I went into the Shopify store and tried to make this be 2799.00  but the editor is refusing to accept that and is automatically defaulting to a comma again. How can we rectify that? 

EmmanuelFlossie
Shopify Partner
3460 264 834

You need to replace the comma programmatically.

replace: ',', '.'

And below you can see how it's done using a value.

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
Scott-JBW
Visitor
2 0 0

Thanks for getting back to me.

Where you say I need to replace the comma programmatically and then you added - you can see below how its done using a value.

I wasn't sure where I am applying this within Shopify? Do I need to get a particular liquid file to adapt this in order to accept that change where you have the - replace: ',', '.' - as you can tell I am not a programmer 🙂

Feelou
Visitor
1 0 0

Hello Emmanuel, 

I appear to have the same error : invalid floating comma in property price. Could you maybe help me how to solve it? 

When I want to adjust the price in Shopify, it automatically puts a comma instead of a point. 

 

Hope to hear from you, 

 

Anne

 

Feelou_0-1727794653798.png

 

EmmanuelFlossie
Shopify Partner
3460 264 834

I have explained what you can do, if you know how to code, in one of my replies below. That is the fix.

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.

Bushy
Visitor
2 0 1

I have the same issue (invalid floating point number in property "price" ) on 560+ items, can anyone give a step by step instructional on how to fix this issue in the shopify code?

@magecomp your 4th suggestion is
If there are any other characters or symbols in the price field, remove them and save the changes.

How do you locate this information in the shopify liquid code? 

oztaurus
Visitor
1 0 1

I have just received the same error, a price over $1000.00 is automatically rendered with a comma $1,000.00, the edit price field won't let me delete that comma

PhilipRoberts
Tourist
4 0 1

I have the exact same issue.  It auto-adds the Comma for anything over 1000.  Did you have any luck with this?

EmmanuelFlossie
Shopify Partner
3460 264 834

If you are experienced in coding do the following

 

{%- assign fa_current_variant = product.selected_or_first_available_variant -%}
{%- assign fa_product_price = fa_current_variant.price | money_without_currency | remove:'.' | replace: ',', '.' -%}

 

And then in the structured data do:

"price": "{{ fa_product_price }}",
Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
PhilipRoberts
Tourist
4 0 1

Thanks Emmanuel.  I would not label myself "experienced" but I've dabbled.  If you let me know which section, I'd give it a go.  Thanks again - Philip.

EmmanuelFlossie
Shopify Partner
3460 264 834
<!-- Copyright FeedArmy 2022 Version 3.18 -->
<!-- FeedArmy tutorial found at https://feedarmy.com/kb/shopify-microdata-for-google-shopping/ -->

<!-- CODE SETTINGS START -->
<!-- CODE SETTINGS START -->

<!-- Please add your alpha2 code, you can find it here: https://help.shopify.com/en/api/custom-storefronts/storefront-api/reference/enum/countrycode -->
{%- assign fa_product_id_alpha2_code = 'US' -%}

<!-- set your product id values are default, product_id, parent_id, sku-->
{%- assign fa_product_id = 'default' -%}

<!-- CODE SETTINGS END -->
<!-- CODE SETTINGS END -->

<!-- ==================================== -->
<!-- DO NOT EDIT ANYTHING BELOW THIS LINE -->

{%- if template contains 'product' -%}

{%- assign fa_current_variant = product.selected_or_first_available_variant -%}

{%- if fa_product_id == 'default' -%}
{%- capture fa_product_id_value -%}shopify_{{ fa_product_id_alpha2_code }}_{{ product.id }}_{{ fa_current_variant.id }}{%- endcapture -%}
{%- elsif fa_product_id == 'product_id' -%}
{%- capture fa_product_id_value -%}{{ fa_current_variant.id }}{%- endcapture -%}
{%- elsif fa_product_id == 'parent_id' -%}
{%- capture fa_product_id_value -%}{{product.id }}{%- endcapture -%}
{%- elsif fa_product_id == 'sku' -%}
{%- capture fa_product_id_value -%}{{ fa_current_variant.sku | escape }}{%- endcapture -%}
{%- endif -%}

{%- if cart.currency.iso_code == 'GBP' or cart.currency.iso_code == 'USD' or cart.currency.iso_code == 'AUD' or cart.currency.iso_code == 'AED' or cart.currency.iso_code == 'CAD' or cart.currency.iso_code == 'BWP' or cart.currency.iso_code == 'BND' or cart.currency.iso_code == 'DOP' or cart.currency.iso_code == 'GTQ' or cart.currency.iso_code == 'HKD' or cart.currency.iso_code == 'INR' or cart.currency.iso_code == 'ILS' or cart.currency.iso_code == 'YEN' or cart.currency.iso_code == 'KES' or cart.currency.iso_code == 'KOR' or cart.currency.iso_code == 'LBP' or cart.currency.iso_code == 'MYR' or cart.currency.iso_code == 'MXN' or cart.currency.iso_code == 'NPR' or cart.currency.iso_code == 'NZD' or cart.currency.iso_code == 'NIO' or cart.currency.iso_code == 'NGN' or cart.currency.iso_code == 'PKR' or cart.currency.iso_code == 'CNY' or cart.currency.iso_code == 'PHP' or cart.currency.iso_code == 'SGD' or cart.currency.iso_code == 'LKR' or cart.currency.iso_code == 'CHF' or cart.currency.iso_code == 'TWD' or cart.currency.iso_code == 'TSH' or cart.currency.iso_code == 'THB' or cart.currency.iso_code == 'UGX' or cart.currency.iso_code == 'KWD' or cart.currency.iso_code == 'CLP' or cart.currency.iso_code == 'BHD' -%}
{%- assign fa_product_price = fa_current_variant.price | money_without_currency | remove:',' -%}
{%- else -%}
{%- assign fa_product_price = fa_current_variant.price | money_without_currency | remove:'.' | replace: ',', '.' -%}
{%- endif -%}


<script type="application/ld+json" data-creator_name="FeedArmy">
{
  "@context": "http://schema.org/",
  "@type": "Product",
  "@id": {{ canonical_url | json }},
  "name": "{{ product.title | strip_html | escape }}",
  "url": "{{ shop.url }}{{ product.url }}",
  "sku": "{{fa_product_id_value}}",
  {%- if product.variants.first.barcode.size >= 12 and product.variants.first.barcode.size <= 14 -%}
  "gtin": {{ product.variants.first.barcode }},
  {%- endif -%}
  "productID": "{{ product.id }}",
  "brand": {
    "@type": "Brand",
    "name": "{{ product.vendor | escape }}"
  },
  "description": {{ product.description | strip_html | json }},
  "image": "https:{{ product.featured_image.src | img_url: '1500x1500' }}",
  {%- if product.variants -%}
    "offers":
      {
        "@type" : "Offer",
        "priceCurrency": "{{ cart.currency.iso_code }}",
        "price": "{{ fa_product_price }}",
        "itemCondition" : "http://schema.org/NewCondition",
        "availability" : "http://schema.org/{% if fa_current_variant.available %}InStock{% else %}OutOfStock{% endif %}",
        "url" : "{{ shop.url }}{{ fa_current_variant.url }}",
            {%- if fa_current_variant.image -%}
              {%- assign variant_image_size = fa_current_variant.image.width | append: 'x' -%}
              "image": "https:{{ fa_current_variant.image.src | img_url: variant_image_size }}",
            {%- else -%}
              "image": "https:{{ product.featured_image.src | img_url: '1500x1500' }}",
            {%- endif -%}
            {%- if fa_current_variant.title != 'Default Title' -%}
              "name" : "{{ product.title | strip_html | escape }} - {{ fa_current_variant.title | escape }}",
            {%- else -%}
              "name" : "{{ product.title | strip_html | escape }}",
            {%- endif -%}
            {%- if fa_current_variant.barcode.size >= 12 and fa_current_variant.barcode.size <= 14 -%}
              "gtin": {{ product.variants.first.barcode }},
            {%- endif -%}
			        "sku": "{{fa_product_id_value}}",
            {%- if product.description != blank -%}
            "description" : {{ product.description | strip_html | json }},
            {%- endif -%}
          "priceValidUntil": "{{ 'now' | date: '%s' | plus: 31536000 | date: '%Y-%m-%d' | uri_encode | replace:'+','%20' }}"
      }
    {%- if product.variants.size > 1 -%},
      "additionalProperty": [{
        "@type": "PropertyValue",
        "propertyID": "item_group_id",
        "value": "{{ product.id }}"
      }]
      {%- endif -%}
    {%- if product.metafields.spr.reviews -%}
    {%- assign fa_rating = product.metafields.spr.reviews | split: '"reviewCount": "' | last | split: '"' | first | plus: 0 -%}
    {%- if fa_rating > 0 -%}
    ,"aggregateRating": {
     "@type": "AggregateRating",
     "ratingValue": {{ product.metafields.spr.reviews | split: '"ratingValue": "' | last | split: '"' | first | plus: 0 }},
     "ratingCount": {{ product.metafields.spr.reviews | split: '"reviewCount": "' | last | split: '"' | first | plus: 0 }}
    }
    {%- endif -%}
    {%- endif -%}
  {%- endif -%}
}
</script>
{%- endif -%}
<!-- Copyright FeedArmy 2022 Version 3.18 -->
Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.