Don't Show Trustpilot Product Review Widget When There's No Reviews

Don't Show Trustpilot Product Review Widget When There's No Reviews

jgoreLOC
Visitor
3 0 0

HI, 

I'm in the process of updating our website to the warehouse theme.

We have implemented a truspilot widget on our product pages. 

I would like for the trustpilot container not to show when it is blank. It is blank when there are no reviews associated with a product.

Regards, 

Jason

<section class="section">

<div class="container ">
<header class="section__header">
<h2 class="section__title heading h3">Trustpilot Reviews</h2>
</header>

<!-- TrustBox widget - Product Reviews SEO -->
<div class="container-back-white">
<div class="trustpilot-widget" data-locale="en-US" data-template-id="5717796816f630043868e2e8" data-businessunit-id="5ff594868724670001c8c68b" data-style-height="300px" data-style-width="100%" data-theme="light" data-sku="{% assign current_variant = product.selected_or_first_available_variant %}{{ current_variant.sku }}"data-name="{{ product.title }}" data-review-languages="en" data-no-reviews="hide">
<a href="https://www.trustpilot.com/review/locoscooters.ie" target="_blank" rel="noopener">Trustpilot</a>
</div>
<!-- End TrustBox widget -->

</div>
</div>
</section>


{% schema %}
{
"name": "Section name",
"settings": []
}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

Screenshot 2021-07-07 at 12.31.32.pngScreenshot 2021-07-07 at 12.31.44.png

<section class="section">

<div class="container ">
<header class="section__header">
<h2 class="section__title heading h3">Trustpilot Reviews</h2>
</header>

<!-- TrustBox widget - Product Reviews SEO -->
<div class="container-back-white">
<div class="trustpilot-widget" data-locale="en-US" data-template-id="5717796816f630043868e2e8" data-businessunit-id="5ff594868724670001c8c68b" data-style-height="300px" data-style-width="100%" data-theme="light" data-sku="{% assign current_variant = product.selected_or_first_available_variant %}{{ current_variant.sku }}"data-name="{{ product.title }}" data-review-languages="en" data-no-reviews="hide">
<a href="https://www.trustpilot.com/review/locoscooters.ie" target="_blank" rel="noopener">Trustpilot</a>
</div>
<!-- End TrustBox widget -->

</div>
</div>
</section>


{% schema %}
{
"name": "Section name",
"settings": []
}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

Replies 5 (5)

mkamalkayani
Shopify Partner
87 8 16

Hi jason,

Have you been able to solve the issue, if not I would love to do that. Feel free to send me a personal message.

Regards,
Kamal

NeerajThakur123
Shopify Partner
1 0 0

Can you please let us know how we can do this. I am getting the same.

MooseDeveloper
Shopify Partner
1 0 0

Hi @mkamalkayani, did you have any success with this?

mkamalkayani
Shopify Partner
87 8 16

Hi @MooseDeveloper , I didn't work on it.

andriiuok
Shopify Partner
1 0 0
data-no-reviews="collapse"