YOTPO Reviews not displaying

Solved
Highlighted
Tourist
10 1 3

Hello,  

 

We just added YOTPO reviews to our store and got a review already but it is not displaying on the product page.  

 

This the product page that it should display on. 

 

https://www.kricklewoodfarm.com/collections/all-products/products/sunflower-oil-500-ml

 

In the YOTPO dashboard the review is marked as published.   When we installed the YOTPO it seemed pretty straight forward, not so much for the adding the stars (product.liquid versus product.template.liquid) but I thought I should see the review even without the stars?  

 

We are using the Alchemy theme.  

 

Any help on this would be appreciated.  

 

Thanks in advance!

0 Likes
Highlighted
Shopify Partner
714 106 265

Can't see any Yotpo code outputting on that page so I'd say the automatic installation hasn't/doesn't work for your theme and your going to have to install the required code manually as per this guide https://support.yotpo.com/en/article/shopify-installing-yotpo

If helpful then please Like and Accept Solution
1 Like
Highlighted
Tourist
10 1 3
Thanks, will give it a try.
0 Likes
Highlighted
Tourist
10 1 3

Hi John,  Thanks, I went through the manual install and things are good now.    I added a reviews page too, just need to add to menus. 

 

Followup question:  On the product page https://www.kricklewoodfarm.com/collections/all-products/products/sunflower-oil-500-ml

 

I have 2 reviews, so far so good.  If I hover over the words '2 Reviews', it turns blue and gives me the hand to indicate a link.  It doesn't take me anywhere though.  Am I missing something?  I'm thinking it should open a window with reviews for that product? 

 

Thanks again for any advice/suggestions.    

 

Dale 

0 Likes
Highlighted
Shopify Partner
714 106 265

Yes clicking that link should take you to the actual reviews that should be getting outputted to that page. What I can see from the front end though is that the code for the reviews widget is in the wrong place (step 2 in the guide I gave the link to). It's wrapped in with your JSON+LD schema (which will cause you issues with Google in terms of structured data). My guess, without being able to see the backend is that you have put the code for the reviews widget inside the <script> </script> tags for the JSON+LD code, it needs to be outside of that script i.e. the absolutely last thing in that code.

 

Screenshot 2020-04-13 at 17.02.04.png

If helpful then please Like and Accept Solution
0 Likes
Highlighted
Tourist
10 1 3

Hi Again,

 

I thought I did step 2 correctly, add the code at the very bottom of the product.liquid file? 

 

Here's the whole file with the script at the end.  Something look out of place?  

 

Thanks

 

Dale

 

{% section 'product-template' %}

{% section 'product-features' %}

<div class="container">
<div id="shopify-product-reviews" class="theme-product-reviews-full" data-id="{{ product.id }}">{{ product.metafields.spr.reviews }}</div>
</div>

{% section 'product-recommendations' %}

<script type="application/json" id="ProductJson-{{ product.id }}">
{{ product | json }}
</script>

{% assign current_variant = product.selected_or_first_available_variant %}

<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"name": {{ product.title | json }},
"url": {{ shop.url | append: product.url | json }},
{%- if product.featured_image -%}
{%- assign image_size = product.featured_image.width | append: 'x' -%}
"image": [
{{ product.featured_image.src | img_url: image_size | prepend: "https:" | json }}
],
{%- endif -%}
"description": {{ product.description | strip_html | json }},
{%- if current_variant.sku != blank -%}
"sku": {{ current_variant.sku | json }},
{%- endif -%}
"brand": {
"@type": "Thing",
"name": {{ product.vendor | json }}
},
"offers": [
{%- for variant in product.variants -%}
{
"@type" : "Offer",
{%- if variant.sku != blank -%}
"sku": {{ variant.sku | json }},
{%- endif -%}
"availability" : "http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}",
"price" : {{ variant.price | divided_by: 100.00 | json }},
"priceCurrency" : {{ cart.currency.iso_code | json }},
"url" : {{ shop.url | append: variant.url | json }}
}{% unless forloop.last %},{% endunless %}
{%- endfor -%}
]
}

<div class="yotpo yotpo-main-widget" data-product-id="{{ product.id }}" data-name="{{ product.title | escape }}" data-url="{{ shop.url }}{{ product.url }}" data-image-url="{{ product.featured_image | product_img_url: 'large' |replace: '?', '%3F' | replace: '&','%26'}}" data-price="{{ variant.price | money_without_currency }}"
data-currency=“{{ shop.currency }}” data-description=“{{ product.description | escape }}“>
{%- assign yotpo_offload_content = shop.metafields.yotpo.yotpo_offload_content %}
{%- assign time_now = ‘now’ | date: ‘%s’ %}
{%- assign yotpo_live_time = shop.metafields.yotpo.yotpo_live | date: ‘%s’ %}
{%- assign diff_seconds_from_live = time_now | minus: yotpo_live_time %}
{%- assign yotpo_main_widget_last_updated = product.metafields.yotpo.main_widget_update_time | date: ‘%s’ %}
{%- assign diff_seconds_from_last_main_widget_update = time_now | minus: yotpo_main_widget_last_updated %}
{%- if yotpo_live_time and diff_seconds_from_live < 86400 or yotpo_main_widget_last_updated and diff_seconds_from_last_main_widget_update < 86400 -%}
{%- assign yotpo_main_widget_obsolete = false %}
{%- else %}
{%- assign yotpo_main_widget_obsolete = true %}
{%- endif %}
{%- if yotpo_offload_content == ‘yes’ and yotpo_main_widget_obsolete != true -%}
{%- for field in product.metafields.yotpo_reviews -%}
{{ field | last }}
{%- endfor -%}
{%- endif %}
</div>

0 Likes
Highlighted
Shopify Partner
714 106 265

Yep you've managed to lose a closing </script> tag somehow, so your code should look like the below (basically you just need to add the closing </script> tag I have highlighted in red):

 

<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"name": {{ product.title | json }},
"url": {{ shop.url | append: product.url | json }},
{%- if product.featured_image -%}
{%- assign image_size = product.featured_image.width | append: 'x' -%}
"image": [
{{ product.featured_image.src | img_url: image_size | prepend: "https:" | json }}
],
{%- endif -%}
"description": {{ product.description | strip_html | json }},
{%- if current_variant.sku != blank -%}
"sku": {{ current_variant.sku | json }},
{%- endif -%}
"brand": {
"@type": "Thing",
"name": {{ product.vendor | json }}
},
"offers": [
{%- for variant in product.variants -%}
{
"@type" : "Offer",
{%- if variant.sku != blank -%}
"sku": {{ variant.sku | json }},
{%- endif -%}
"availability" : "http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}",
"price" : {{ variant.price | divided_by: 100.00 | json }},
"priceCurrency" : {{ cart.currency.iso_code | json }},
"url" : {{ shop.url | append: variant.url | json }}
}{% unless forloop.last %},{% endunless %}
{%- endfor -%}
]
}

</script>

<div class="yotpo yotpo-main-widget" data-product-id="{{ product.id }}" data-name="{{ product.title | escape }}" data-url="{{ shop.url }}{{ product.url }}" data-image-url="{{ product.featured_image | product_img_url: 'large' |replace: '?', '%3F' | replace: '&','%26'}}" data-price="{{ variant.price | money_without_currency }}"
data-currency=“{{ shop.currency }}” data-description=“{{ product.description | escape }}“>
{%- assign yotpo_offload_content = shop.metafields.yotpo.yotpo_offload_content %}
{%- assign time_now = ‘now’ | date: ‘%s’ %}
{%- assign yotpo_live_time = shop.metafields.yotpo.yotpo_live | date: ‘%s’ %}
{%- assign diff_seconds_from_live = time_now | minus: yotpo_live_time %}
{%- assign yotpo_main_widget_last_updated = product.metafields.yotpo.main_widget_update_time | date: ‘%s’ %}
{%- assign diff_seconds_from_last_main_widget_update = time_now | minus: yotpo_main_widget_last_updated %}
{%- if yotpo_live_time and diff_seconds_from_live < 86400 or yotpo_main_widget_last_updated and diff_seconds_from_last_main_widget_update < 86400 -%}
{%- assign yotpo_main_widget_obsolete = false %}
{%- else %}
{%- assign yotpo_main_widget_obsolete = true %}
{%- endif %}
{%- if yotpo_offload_content == ‘yes’ and yotpo_main_widget_obsolete != true -%}
{%- for field in product.metafields.yotpo_reviews -%}
{{ field | last }}
{%- endfor -%}
{%- endif %}
</div>

If helpful then please Like and Accept Solution
1 Like
Highlighted
Tourist
10 1 3

This is an accepted solution.

Thanks, that did it.  Appreciate all your help, stay safe on your side of the pond!  

0 Likes
Highlighted
Shopify Partner
714 106 265

No problem. You too.

If helpful then please Like and Accept Solution
0 Likes