Need to remove zero reviews on collections page

Highlighted
Excursionist
14 0 3

Hi everyone

Had a hunt around on here and google but cant seem to find the answer.

please see the following link

https://stellarugs.com.au/collections/classic-design

 

As you can see between product title and price there is (0) as there are no reviews.

 

the theme has a file which i believe needs to have an edit to stop the display of the (0)

 

sw-widget-avg-rate-listing.liquid which is as follows

 

{% assign ssw_review_enabled = 1 %}
{% if shop.metafields.ssw['review_enabled'] %}
{% assign ssw_review_enabled = shop.metafields.ssw['review_enabled'] %}
{% endif %}
{% if ssw_review_enabled == 1 %}
{% assign ssw_count_rate = 0 %}
{% assign ssw_avg_rate = 0 %}
{% assign ssw_rate_data_key = 'review' %}
{% assign ssw_unite_reviews = 0 %}
{% if shop.metafields.ssw['unite_reviews'] %}
{% assign ssw_unite_reviews = shop.metafields.ssw['unite_reviews'] %}
{% endif %}
{% if ssw_unite_reviews == 1 %}
{% if shop.metafields.ssw['unite_product_ids'] %}
{% assign ssw_unite_product_ids = shop.metafields.ssw['unite_product_ids'] | split: ',' %}
{% assign unite_product_id = product.id | downcase %}
{% if ssw_unite_product_ids contains unite_product_id %}
{% assign ssw_rate_data_key = 'unite_review' %}
{% endif %}
{% endif %}
{% endif %}
{% if product.metafields.ssw[ssw_rate_data_key] %}
{% assign ssw_count_rate = product.metafields.ssw[ssw_rate_data_key].count | plus: 0 %}
{% assign ssw_avg_rate = product.metafields.ssw[ssw_rate_data_key].avg | plus: 0 %}
{% assign ssw_product_id = product.id %}
{% if product.metafields.ssw[ssw_rate_data_key].product_id %}
{% assign ssw_product_id = product.metafields.ssw[ssw_rate_data_key].product_id | plus: 0 %}
{% endif %}
{% if ssw_product_id != product.id %}
{% assign ssw_count_rate = 0 %}
{% endif %}
{% endif %}

<div class="ssw-widget-avg-rate-listing ssw-stars ssw-stars-large {% if ssw_count_rate == 0 %}ssw-hide{% endif %}" >
{% assign ssw_j = ssw_avg_rate | floor %}
{% for i in (1..ssw_j) %}
<i class="ssw-icon-star"></i>
{% endfor %}
{% assign ssw_rate_last_star = 5 | minus:ssw_avg_rate %}
{% assign ssw_y = ssw_rate_last_star | floor %}
{% assign ssw_x = ssw_avg_rate | minus:ssw_j %}
{% if ssw_x > 0.74 %}
<i class="ssw-icon-star"></i>
{% else %}
{% if ssw_x > 0.24 %}
<i class="ssw-icon-star-half-alt"></i>
{% else %}
{% if ssw_x > 0 %}
{% assign ssw_y = ssw_y | plus:1 %}
{% endif %}
{% endif %}
{% endif %}
{% for i in (1..ssw_y) %}
<i class="ssw-icon-star-empty"></i>
{% endfor %}
<span class="ssw-review-count"> ({{ssw_count_rate}}) </span>
</div>
{% endif %}

 


Any ideas and help greatly appreciated

 

Rae

 

0 Likes
Highlighted
Shopify Expert
100 15 14

Replace 

<span class="ssw-review-count"> ({{ssw_count_rate}}) </span>


With:

{% if ssw_count_rate != 0 %}
<span class="ssw-review-count"> ({{ssw_count_rate}}) </span>
{% endif %}
Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing
0 Likes
Highlighted
Excursionist
14 0 3
Thank you so much !! worked like charm
0 Likes
Highlighted
Excursionist
14 0 3

thanks Pallavi !

0 Likes