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
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 %}
Hello guys,
i have the same issue. i use the app Areviews for product ranking. However, i need to remove zero reviews on collection page..this code works with me only in the product page:
span [data-rating="0.0"] {
display: none;
}
i want to hide reviews as well on products into collection and in the home page without reviews..it is not working at all.
attached the pictures of the issue
attached you find
i really appreciate your help!
Lem
User | Count |
---|---|
395 | |
205 | |
129 | |
47 | |
42 |