Our Shopify store is showing "Missing field price" ERROR for Google Search console.

TDWisco
New Member
7 0 0

Our Shopify store is showing "Missing field price" ERRORS on google search console for 216 of our products. But all the price fields have prices. How do we fix this?

 

Replies 12 (12)

Mircea_Piturca
Shopify Partner
1547 44 345

Google picks up that info from Rich Snippets.

The price format can be wrong there.

 

It would help the forum users to have a link to your store in order to debug this.

Finally—Add variant descriptions to your products
Mircea_Piturca
Shopify Partner
1547 44 345

Thanks for the link.

 

There are several warnings and errors: https://search.google.com/structured-data/testing-tool#url=https%3A%2F%2Ftommydocks.com%2Fcollection...

The biggest one is the missing price data on the product offer, that microdata is missing from the offer.

 

Your theme has microdata Rich Snippets. The data is "added" on the theme HTML elements.

This will work but is error prone, each time some change is done to the markup this can break.

 

A better way would be to have the Rich Snippets assigned as JSON-LD.

You can see some examples here: https://developers.google.com/search/docs/data-types/product

 

As a quick fix on the error.

In your theme, find this line of code:

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">

Can be on the product.liquid template, a product section or even a snippet...

 

Add the price microdata:

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

Should look something like this:

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  <meta itemprop="price" content="{{ product.price | money_without_currency }}">
  ...

Revalidate using the  https://search.google.com/structured-data/testing-tool

Finally—Add variant descriptions to your products
Young0886
Tourist
11 0 9

I have this same error and have been unable to resolve.  Www.floridagiftsonline.com

mu545
Visitor
2 0 1

I have same issue.
This issue came from not valid currency price format, go to settings -> genernal then change currency formating to {{ amount_no_decimals_with_comma_separator }}
You can see list options of currency format at https://help.shopify.com/en/manual/payments/currency-formatting#currency-formatting-options
After currency format changed, test your url product with google search tool https://search.google.com/structured-data/testing-tool
Screenshot_20200131_085748.png

Young0886
Tourist
11 0 9
Thank you so much for taking your time to respond and help me out.

I tried the suggestion but I still get an error. I attached what it now
looks like.
mu545
Visitor
2 0 1

Maybe your template code not set microdata schema correctly.
To do these add file microdata-schema.liquid to your snippets code, go to themes -> edit code

 

Screenshot_20200131_095212.png

 

Add below code and name as microdata-schema.liquid

{%- comment -%}
This snippet structures the micro-data using JSON-LD specification. Please note that for Product especially,
the schema often changes. We try to output as much info as possible, but Google may add new requirements over time,
or change the format of some info
{%- endcomment -%}

{%- if request.page_type == 'product' -%}
  {%- assign days_product_price_valid_until = 10 | times: 86400 -%}

  {%- assign gtin_option = 'gtin' -%}
  {%- if product.selected_or_first_available_variant.barcode != blank -%}
    {%- assign is_barcode_available = true -%}
    {%- assign gtin_string_length = product.selected_or_first_available_variant.barcode | size -%}

    {%- if gtin_string_length == 8 or gtin_string_length == 12 or gtin_string_length == 13 or gtin_string_length == 14 -%}
      {%- assign is_valid_gtin_length = true -%}
      {%- assign gtin_option = gtin_option | append: gtin_string_length -%}
    {%- endif -%}
  {%- endif -%}

  {%- assign has_reviews = false -%}
  {%- assign rating_value = blank -%}
  {%- assign review_count = blank -%}
  {%- if product.metafields.spr.reviews != blank -%}
    {%- assign rating_value_review_array = product.metafields.spr.reviews | split: 'meta itemprop="ratingValue" content="' -%}
    {%- assign rating_value_arr = rating_value_review_array[1] |split: '"' -%}
    {%- assign rating_value = rating_value_arr[0] -%}
    {%- assign review_count_str_array = product.metafields.spr.reviews | split: 'meta itemprop="reviewCount" content="' -%}
    {%- assign review_count_arr = review_count_str_array[1] | split: '"' -%}
    {%- assign review_count = review_count_arr[0] -%}

    {%- unless review_count == blank -%}
      {%- assign has_reviews = true -%}
    {%- endunless -%}
  {%- endif -%}

  {%- capture main_entity_microdata -%}
    "@type": "Product",
    "offers": [
      {%- for variant in product.variants -%}
        {
          "@type": "Offer",
          "name": {{ variant.title | json }},
          "availability": {%- if variant.available -%}"https://schema.org/InStock"{%- else -%}"https://schema.org/OutOfStock"{%- endif -%},
          "price": {{ variant.price | money_without_currency | json }},
          "priceCurrency": {{ shop.currency | json }},
          "priceValidUntil": "{{ 'now' | date: '%s' | plus: days_product_price_valid_until | date: '%Y-%m-%d'}}",
          {%- if variant.sku != blank -%}
            "sku": {{ variant.sku | json }},
          {%- endif -%}
          "url": "{{ request.path }}{{ variant.url }}"
        }{% unless forloop.last %},{% endunless %}
      {%- endfor -%}
    ],
    {%- if is_barcode_available and is_valid_gtin_length %}
      "{{gtin_option}}": {{ product.selected_or_first_available_variant.barcode | json }},
      "productId": {{ product.selected_or_first_available_variant.barcode | json }},
    {%- elsif is_barcode_available %}
      "mpn": {{ product.selected_or_first_available_variant.barcode | json }},
      "productId": {{ product.selected_or_first_available_variant.barcode | json }},
    {%- endif %}
    {%- if has_reviews -%}
      "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "{{ rating_value }}",
        "reviewCount": "{{ review_count }}"
      },
    {%- endif %}
    "brand": {
      "name": {{ product.vendor | json }}
    },
    "name": {{ product.title | json }},
    "description": {{ product.description | strip_html | json }},
    "category": {{ product.type | json }},
    "url": "{{ request.path }}{{ product.url }}",
    "sku": {{ product.selected_or_first_available_variant.sku | json }},
    "image": {
      "@type": "ImageObject",
      "url": "https:{{ product.featured_image | img_url: '1024x' }}",
      "image": "https:{{ product.featured_image | img_url: '1024x' }}",
      "name": {{ product.featured_image.alt | json }},
      "width": "1024",
      "height": "1024"
    }
  {%- endcapture -%}
{%- elsif request.page_type == 'article' -%}
  {%- capture main_entity_microdata -%}
    "@type": "BlogPosting",
    "mainEntityOfPage": "{{ article.url }}",
    "articleSection": {{ blog.title | json }},
    "keywords": "{{ article.tags | join: ', ' }}",
    "headline": {{ article.title | json }},
    "description": {{ article.excerpt_or_content | strip_html | truncatewords: 25 | json }},
    "dateCreated": "{{ article.created_at | date: '%Y-%m-%dT%T' }}",
    "datePublished": "{{ article.published_at | date: '%Y-%m-%dT%T' }}",
    "dateModified": "{{ article.published_at | date: '%Y-%m-%dT%T' }}",
    "image": {
      "@type": "ImageObject",
      "url": "https:{{ article.image | img_url: '1024x' }}",
      "image": "https:{{ article.image | img_url: '1024x' }}",
      "name": {{ article.image.alt | json }},
      "width": "1024",
      "height": "1024"
    },
    "author": {
      "@type": "Person",
      "name": "{{ article.user.first_name | escape }} {{ article.user.last_name | escape }}",
      "givenName": {{ article.user.first_name | json }},
      "familyName": {{ article.user.last_name | json }}
    },
    "publisher": {
      "@type": "Organization",
      "name": {{ shop.name | json }}
    },
    "commentCount": {{ article.comments_count }},
    "comment": [
      {%- for comment in article.comments limit: 5 -%}
        {
          "@type": "Comment",
          "author": {{ comment.author | json }},
          "datePublished": "{{ comment.created_at | date: '%Y-%m-%dT%T' }}",
          "text": {{ comment.content | json }}
        }{%- unless forloop.last -%},{%- endunless -%}
      {%- endfor -%}
    ]
  {%- endcapture -%}
{%- endif -%}

{%- capture breadcrumb_entity_microdata -%}
  "@type": "BreadcrumbList",
  "itemListElement": [{
      "@type": "ListItem",
      "position": 1,
      "name": {{ 'general.breadcrumb.home' | t | json }},
      "item": "{{ shop.url }}"
    }

    {%- if request.page_type == 'product' -%}
      {%- if collection -%}
        ,{
          "@type": "ListItem",
          "position": 2,
          "name": {{ collection.title | json }},
          "item": "{{ shop.url }}{{ collection.url }}"
        }, {
          "@type": "ListItem",
          "position": 3,
          "name": {{ product.title | json }},
          "item": "{{ shop.url }}{{ product.url | within: collection }}"
        }
      {%- else -%}
        ,{
          "@type": "ListItem",
          "position": 2,
          "name": {{ product.title | json }},
          "item": "{{ shop.url }}{{ product.url }}"
        }
      {%- endif -%}
    {%- elsif request.page_type == 'collection' -%}
        ,{
          "@type": "ListItem",
          "position": 2,
          "name": {{ collection.title | json }},
          "item": "{{ shop.url }}{{ collection.url }}"
        }
    {%- elsif request.page_type == 'blog' -%}
        ,{
          "@type": "ListItem",
          "position": 2,
          "name": {{ blog.title | json }},
          "item": "{{ shop.url }}{{ blog.url }}"
        }
    {%- elsif request.page_type == 'article' -%}
        ,{
          "@type": "ListItem",
          "position": 2,
          "name": {{ blog.title | json }},
          "item": "{{ shop.url }}{{ blog.url }}"
        }, {
          "@type": "ListItem",
          "position": 3,
          "name": {{ blog.title | json }},
          "item": "{{ shop.url }}{{ article.url }}"
        }
    {%- elsif request.page_type == 'page' -%}
       ,{
          "@type": "ListItem",
          "position": 2,
          "name": {{ page.title | json }},
          "item": "{{ shop.url }}{{ page.url }}"
        }
    {%- endif -%}
  ]
{%- endcapture -%}

{% if main_entity_microdata != blank %}
  <script type="application/ld+json">
  {
    "@context": "http://schema.org",
    {{ main_entity_microdata }}
  }
  </script>
{% endif %}

{% if breadcrumb_entity_microdata != blank %}
  <script type="application/ld+json">
  {
    "@context": "http://schema.org",
    {{ breadcrumb_entity_microdata }}
  }
  </script>
{% endif %}


Open file theme.liquid and add below code inside tag <head>

Screenshot_20200131_095438.png

{% render 'microdata-schema' %}

 

BluebellDave
Visitor
1 0 0

Tried this but it didnt appear to work for us. Any thoughts?

Young0886
Tourist
11 0 9

I was able to follow right up until the part where you add the part below.  What do you mean to add it inside tag <head>?  Sorry, I literally have no clue about this.  

{% render 'microdata-schema' %}

 I can see the head section:

 

<!doctype html>
<html class="no-js" lang='en'>
<head>
<meta name="google-site-verification" content="xTNYP6BBhmpD7wby9EoUvEDPH2xD4B0IxZyvy-XM5Ik" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

{% if template contains 'collection' and current_tags %}
<meta name="robots" content="noindex" />
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% else %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}

<title>
{{ page_title }}

funkeinstein
Visitor
1 0 0

Thank you mate!

This one solved my problem.

monikatyagi
Visitor
1 0 0

We are having a similar problem on our product page: https://chalktreewaxcandles.com/products/wax-melter

SunnyPossum
Tourist
5 1 0

I also had a problem with "missing field price". I have done what you suggested and it helped!

Thanks a lot! 🙂