In this article I'll teach you how to remove the rating and reviews section from the product comparison page in OpenCart.

If you've read my previous article on how to disable product reviews in OpenCart you should already know how to login to your OpenCart admin dashboard to turn off the product reviews from showing on your products. However if a user clicks on the Add to Compare link beside a product, and then they click on the product comparison page the product reviews will still display here.

It would probably be helpful to first learn about how to edit a OpenCart template before continuing, as this is the process we'll be using to make our modifications to OpenCart's product comparison page.

Disable rating and reviews from product comparisons

Using the steps below you should be able to modify your OpenCart compare.tbl template in order to not display any information regarding the rating or reviews of products.

  1. Open up the File Manager Code Editor in cPanel and edit the following file:

    /catalog/view/theme/default/template/product/compare.tpl

    You should also backup the file before editing to be on the safe side.

  2. Around line 65 you'll want to comment out or remove the following block of code:

    <tr>
    <td><?php echo $text_rating; ?></td>
    <?php foreach ($products as $product) { ?>
    <td><img src="/support/catalog/view/theme/default/image/stars-<?php echo $products[$product['product_id']]['rating']; ?>.png" alt="<?php echo $products[$product['product_id']]['reviews']; ?>" /><br />
    <?php echo $products[$product['product_id']]['reviews']; ?></td>
    <?php } ?>
    </tr>

    To simply comment these lines out begin with <!-- and end with --> around the code so it ends up looking like this:

    <!--<tr>
    <td><?php echo $text_rating; ?></td>
    <?php foreach ($products as $product) { ?>
    <td><img src="/support/catalog/view/theme/default/image/stars-<?php echo $products[$product['product_id']]['rating']; ?>.png" alt="<?php echo $products[$product['product_id']]['reviews']; ?>" /><br />
    <?php echo $products[$product['product_id']]['reviews']; ?></td>
    <?php } ?>
    </tr>-->

     


    Product reviews enabled.

    compare products product reviews enabled

    Product reviews removed.

    compare products product reviews disabled
     

You should now know how to remove the rating and reviews section from the product comparison page in OpenCart.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

News / Announcements

WordPress wp-login.php brute force attack
Updated 2014-07-17 06:43 pm EST
Hits: 200924

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!