Judge.me helps you collect and display ratings and reviews about your products and Shopify store. Here is our guide made for Judge.me integration with Searchly App.


About Judge.me


1. App Information

2. Judge.me Integration Benefit

  • Show your reviews everywhere during navigation time and get profit right away.

  • Exclusive offer for Boost Commerce customers: Install now to get a 45-day trial.


Instructions


1- Go to the Searchly-filter.js file in your current theme & copy the following snippet:

// For Searchly-filter.js 

'{{itemReviews}}'

  • Go to searchly-filter-html.liquid file in your current theme & copy the following snippet:


// For searchly-filter-html.liquid
[[itemReviews]]

2- Add the below script to the ProductGridItem.prototype.compileTemplate function:

itemHtml = itemHtml.replace(/{{itemReviews}}/g, buildReviews(data));

return itemHtml;
}
function buildReviews(data)
{
//Build Labels
var html = '';
if (data.review_ratings && data.review_ratings !== '0.0') {
html = "<div class='jdgm-widget jdgm-preview-badge' data-id='" + data.id + "'>" +
"<div class='jdgm-prev-badge' data-average-rating={{reviewRatings}} data-number-of-reviews={{reviewCount}} data-number-of-questions='0'> <span class='jdgm-prev-badge__stars' data-score={{reviewRatings}} tabindex='0' aria-label='{{reviewRatings}} stars'> {{reviewStars}} </span> <span class='jdgm-prev-badge__text'> {{reviewCount}} review </span> </div>".replace(/\|/g, '"').replace(/{{reviewRatings}}/g, data.review_ratings).replace(/{{reviewCount}}/g, data.review_count )
+ "</div>";

var reviews = parseFloat(data.review_ratings);
var starHtml = '';
for(var i = 1; i <= reviews; i++) {
starHtml += "<span class='jdgm-star jdgm--on'>";
}
if(reviews % 1 !== 0) {
starHtml += "<span class='jdgm-star jdgm--half'>";
}
reviews = Math.ceil(reviews);
for(var i = 5; i > reviews; i--) {
starHtml += "<span class='jdgm-star jdgm--off'>";
}
html = html.replace(/{{reviewStars}}/g, starHtml);
}
return html;
}


Preview


Did this answer your question?