Shopify Review App - Missing 'Author' Field

Paul_Nash1
Excursionist
71 1 2

Hi,

 

Looking for a bit of help on the Shopify review app, I reinstalled a few Months back. Now I'm getting a Google critical error on all the pages with a review ''Missing field "author".

 

I've found some code that supposed to fix the issue 

“author”: {{ customer.first_name |json }}

 

With the instruction 'You can add that XML markup to your product liquid or any other page on your website'

 

But I'm not 100% where it should go.

 

Thanks in advance,

Paul

Replies 7 (7)

saim007
Shopify Partner
496 64 83

Hello @Paul_Nash1 You can fix Google Review Snippet code by following below steps - 

1. Go to Online Store

2. Edit Code

3. Find for product-template.liquid or product.liquid or main-product.liquid whatever your theme file have product file.

4. Go to the end of the code and paste the below code and save!

 

<script type="application/ld+json">
    {
      "@context": "https://schema.org/",
      "@type": "Product",
      "brand": {
        "@type": "Brand",
        "name": {{ product.vendor | json }}
      },
      "description": {{ product.description | strip_html | json }},
      "sku": {{ product.selected_or_first_available_variant.sku | json }},
      "image": "{{ product.featured_image | img_url }}",
      "name": {{ product.title | json }},
      "review": [{
        "@type": "Review",
        "reviewRating": {
          "@type": "Rating",
          "ratingValue": "5"
        },
        "author": {
          "@type": "Person",
          "name":  "{{ review.author }}"
        }
       },
      {
        "@type": "Review",
        "reviewRating": {
          "@type": "Rating",
          "ratingValue": "1"
        },
        "author": {
          "@type": "Person",
          "name": "{{ review.author }}"
        }
      }],
      "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "88",
        "bestRating": "100",
        "ratingCount": "20"
      },
      "offers": {
 {%- for variant in product.variants -%}
        "@type": "Offer",
        "url": {{ request.origin | append: product.url | json }},
        "priceCurrency": {{ cart.currency.iso_code | json }},
        "price": "{{ variant.price | divided_by: 100.00 | json }}",
        "priceValidUntil": "{{ "now" | date: "%Y-%m-%d" }}",
        "itemCondition": "https://schema.org/NewCondition",
         "availability" : "http://schema.org/{% if variant.available %}InStock{% else %}OutOfStock{% endif %}",
{%- endfor -%}
        "seller": {
          "@type": "Organization",
          "name": "{{ shop.name }}"
        }
      }
    }
    </script>

 You can check here what your product is missing Google attributes  - Rich Results Test - Google Search Console

 

Please let me know if works and like mark as solve!

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
Paul_Nash1
Excursionist
71 1 2

Thanks Sandeep,

 

I tried adding it to snippets/product.liquid. Tested it & still getting the same missing field 'author'.

 

Thanks,

Paul

saim007
Shopify Partner
496 64 83

Hi @Paul_Nash1 Can you please share full screenshot of coding part? Because above code is work only in Section/product.liquid or Template product.liquid file.

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
Paul_Nash1
Excursionist
71 1 2

Thanks Sandeep,

 

Its too big to screenshot, I tried getting into a word doc but it won't accept the files, but I've listed everything that says 'product & liquid' in both templates & sections.

In Templates;

index.product_types.liquid

product_recently-viewed.liquid

search.scm.products.handle.js.liquid

search.scm.products.liquid

 

In sections;

ajax-product-count.liquid

dynamic-featured-product.liquid

product-swatch-data.liquid

static-product-3-columns.liquid

static-product-compare.liquid

static-product-recommendations.liquid

static-product-reviews.liquid

static-product.liquid

 

Thanks again,

saim007
Shopify Partner
496 64 83

@Paul_Nash1 Please put the code in static-product.liquid file above the {% schema %}.

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
Paul_Nash1
Excursionist
71 1 2

Thanks,

 

I only have {% endschema %}

If I paste the code above that line, then save I get the error message 

'Unable to update the file' invalid JSON in tag 'schema'

saim007
Shopify Partner
496 64 83

@Paul_Nash1 If there is {% endschema %} word then {% schema %} is must there just find {% schema %} in that file and paste above code before {% schema %}.

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂