How to show Opencart product reviews to search engines?

In Opencart, product reviews are not visible to Google because they are loaded using Jquery code. It is not good from SEO perspective because product reviews can help merchants to improve SEO of their website.

In Opencart, product page loads its main content first and then it uses a Jquery function to load product reviews of the product, due to which product reviews do not come in the source code of the page. Since Google only sees the first loaded content which is available in the page source, therefore products reviews are not crawled by Google.

This issue can be fixed in following three 3 ways:

Method #1

You can use our OpenCart Review Incentive plugin which not only shows your product ratings in Google search result but also makes required changes in Opencart product page so that Google can see all product reviews and can crawl them.

Follow the steps mentioned-below to incorporate the same.

Step 1: Purchase OpenCart Review Incentive extension from the Knowband store and install it in your store. For more information regarding the installation and configuration, click here.

Step 2: Once the installation is complete, enable it from the back-end. Set the content that you want to display at the front-end of the site.

That’s it. The customers can give reviews and they will get incentives in return.

Here are some of the other features offered by OpenCart Review Incentive module:

  • The OpenCart plugin replaces the default review system of OpenCart and shows the reviews in the page source code, so that, search engines can read the reviews.
  • Additionally, the store admin can send email reminders notifying the customers to give their reviews.
  • The customers get incentives in return of the reviews given by them. The store admin can fix the amount that they offer as an incentive to the customers.
  • The automated approach of the OpenCart customer review plugin allows the admin to set the frequency of the email.
  • Additionally, they can track the reviews received and incentives redeemed from the back-end of the OpenCart review incentive module.

Method #2

You can make all required changes by following steps which are mentioned below:

  • Edit file “/catalog/view/theme/your_theme/template/product/product.tpl”
  • Replace the following code

<div id=”review”></div>

with

<div id=”review”><?php echo $allreviews;?></div>

In the same file, you also need to replace the following code

$(‘#review’).load(‘index.php?route=product/product/review&product_id=<?php echo $product_id; ?>’);

with

//$(‘#review’).load(‘index.php?route=product/product/review&product_id=<?php echo $product_id; ?>’);

  • Now edit file “catalog/controller/product/product.php”
  • Search for “$this->load->model(‘catalog/product’);” without double quotes and add following code before first search result.

$result=$this->customreview($product_id);
$data[‘allreviews’]=$result;

Also, search for “public function index() {” without double quotes and add following code before search result.

public function customreview($product_id) {
$this->load->language(‘product/product’);

$this->load->model(‘catalog/review’);

$data[‘text_no_reviews’] = $this->language->get(‘text_no_reviews’);

if (isset($this->request->get[‘page’])) {
$page = $this->request->get[‘page’];
} else {
$page = 1;
}

$data[‘reviews’] = array();

$review_total = $this->model_catalog_review->getTotalReviewsByProductId($product_id);

$results = $this->model_catalog_review->getReviewsByProductId($product_id, ($page – 1) * 5, 5);

foreach ($results as $result) {
$data[‘reviews’][] = array(
‘author’ => $result[‘author’],
‘text’ => nl2br($result[‘text’]),
‘rating’ => (int)$result[‘rating’],
‘date_added’ => date($this->language->get(‘date_format_short’), strtotime($result[‘date_added’]))
);
}

$pagination = new Pagination();
$pagination->total = $review_total;
$pagination->page = $page;
$pagination->limit = 5;
$pagination->url = $this->url->link(‘product/product/review’, ‘product_id=’ . $product_id . ‘&page={page}’);

$data[‘pagination’] = $pagination->render();

$data[‘results’] = sprintf($this->language->get(‘text_pagination’), ($review_total) ? (($page – 1) * 5) + 1 : 0, ((($page – 1) * 5) > ($review_total – 5)) ? $review_total : ((($page – 1) * 5) + 5), $review_total, ceil($review_total / 5));

if (file_exists(DIR_TEMPLATE . $this->config->get(‘config_template’) . ‘/template/product/review.tpl’)) {
return $this->load->view($this->config->get(‘config_template’) . ‘/template/product/review.tpl’, $data);
} else {
return $this->load->view(‘default/template/product/review.tpl’, $data);
}
}

Method #3:

Knowband offers a free module that can help you show the reviews in the page source code and makes it readable by the search engines. Download this free module and install it on your store. Follow below instructions to install it.

  1. Extract the downloaded zip file.
  2. Upload the XML file from Admin panel’s Extensions > Extension Installer page.
  3. Now refresh the modifications from Admin panel’s Extensions > Modifications page.

If you face some issue or need some help to fix this bug, feel free to contact us.

This Would Also Interest You:

Joe Parker

We boast of the best in the industry plugins for eCommerce systems and has years of experience working with eCommerce websites. We provide best plugins for platforms like - Magento, Prestashop, OpenCart and Shopify. We also provide custom module development and customization services for the website and modules.

One thought on “How to show Opencart product reviews to search engines?

  1. Hi,
    I’m using opencart 3.0.2.0 and want to modify it so that google can index my reviews but the instructions above are for an earlier version and some of the files are different – I’ve noticed that the following file now uses twig instead of tpl;
    “/catalog/view/theme/your_theme/template/product/product.tpl”
    Hope you can help.

Leave a Reply

Your email address will not be published. Required fields are marked *