In this article I'll walk you through the process of keeping your social networking share buttons active, after disabling the product reviews in OpenCart.

If you happened to have read my previous article about how to disable product reviews in OpenCart. I went over how you can turn off the ability for customers to see product reviews on your products. However when you disable this feature, it also removes the social media share buttons that exist for each product as well.

Keeping social share buttons

Using the steps below you'll be able to still have your social share buttons, while leaving the product reviews disabled for your OpenCart site.

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

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

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

  2. You'll be looking for code around line 218, where it begins with <?php if ($review_status) { ?>:

    <?php if ($review_status) { ?>
    <div class="review">
    <div><img src="/support/catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" />  <a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $reviews; ?></a>  |  <a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $text_write; ?></a></div>
    <div class="share"><!-- AddThis Button BEGIN -->
    <div class="addthis_default_style"><a class="addthis_button_compact"><?php echo $text_share; ?></a> <a class="addthis_button_email"></a><a class="addthis_button_print"></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a></div>
    <script type="text/javascript" src="//s7.addthis.com/js/250/addthis_widget.js"></script>
    <!-- AddThis Button END -->
    </div>
    </div>
    <?php } ?>

    Copy the code beginning with <div class="share"> down to the last </div> prior to the closing <?php } ?> tag:

    <div class="share"><!-- AddThis Button BEGIN -->
    <div class="addthis_default_style"><a class="addthis_button_compact"><?php echo $text_share; ?></a> <a class="addthis_button_email"></a><a class="addthis_button_print"></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a></div>
    <script type="text/javascript" src="//s7.addthis.com/js/250/addthis_widget.js"></script>
    <!-- AddThis Button END -->
    </div>
    </div>

  3. Directly below the closing <?php } ?> tag and prior to the next <div> tag, insert the following line:

    <div class="review">

    Then proceed to paste your copied code below that added line. You should end up at the end with the full thing looking like this, with the entered in and pasted code in red:

    <?php if ($review_status) { ?>
    <div class="review">
    <div><img src="/support/catalog/view/theme/default/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" />  <a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $reviews; ?></a>  |  <a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $text_write; ?></a></div>
    <div class="share"><!-- AddThis Button BEGIN -->
    <div class="addthis_default_style"><a class="addthis_button_compact"><?php echo $text_share; ?></a> <a class="addthis_button_email"></a><a class="addthis_button_print"></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a></div>
    <script type="text/javascript" src="//s7.addthis.com/js/250/addthis_widget.js"></script>
    <!-- AddThis Button END -->
    </div>
    </div>
    <?php } ?>
    <div class="review">
    <div class="share"><!-- AddThis Button BEGIN -->
    <div class="addthis_default_style"><a class="addthis_button_compact"><?php echo $text_share; ?></a> <a class="addthis_button_email"></a><a class="addthis_button_print"></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a></div>
    <script type="text/javascript" src="//s7.addthis.com/js/250/addthis_widget.js"></script>
    <!-- AddThis Button END -->
    </div>
    </div>

    </div>
    </div>


    Product reviews enabled.

    front end product reviews and social enabled

    Product reviews disabled and social buttons kept.

    front end product reviews disabled social enabled
     

You should now know how to disable the product reviews within OpenCart, but still keep your social networking share buttons active.

Continued Education in Course OpenCart
You are viewing Section 19: 342: Keep social networking links with reviews disabled
Section 18: 343: Remove rating and reviews from product comparison
Section 20: 341: Disable product reviews 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!

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

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.

0 Questions & Comments

Post a comment

Back to first comment | top

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!