Close

Product Reviews - Display of the Total Count on Reviews Tab

nonam
8 years ago
#11786 Quote
Avatar
  • 57
Hello Nop-Templates!

When customers visit the website and look for a particular product, the can see the reviews of that product in the Product details page (Reviews tab). It would be nice if the amount of reviews would show up on the Review tab, as we normally see on the market, so that customers get an appreciation of the feedback  based on the number of reviews submitted. I imagine we can customize this in the cshtml files but would rather see it as part of Theme. I have checked the catalog configuration and could not find anything about it.

If I am missing something, don't hesitate to let me know! Thanks again!
Deni
8 years ago
#11801 Quote
Avatar
  • Moderator
  • 389
Hi, 

Thanks for the suggestion !

We will think about its implementation soon.

For now you can do it with JavaScript. Just make sure the Quick Tabs are not loading with AJAX.
Go to the /Plugins/SevenSpikes.Nop.Plugins.NopQuickTabs/Scripts/ProductTabs.min.js and add this code in its end:

(function ($) {
    $(document).ready(function () {
        setTimeout(function () {
            var productReviewsList = $('.product-review-list');
            var productTabId = productReviewsList.closest('.ui-tabs-panel').attr('id');
            var productReviewsAnchor = $('#quickTabs .ui-tabs-nav > li[aria-controls="' + productTabId + '"]');
            var reviewAnchorText = productReviewsAnchor.find('.ui-tabs-anchor').text() + ' (' + productReviewsList.find('.product-review-item').length + ')';

            productReviewsAnchor.find('.ui-tabs-anchor').text(reviewAnchorText);
        }, 500);
    });
})(jQuery);



I hope this helped !
Best Regards,
Mladen Staykov
Nop-Templates.com
nonam
8 years ago
#11814 Quote
Avatar
  • 57
Wonderful! Thanks a lot!