Knowband Blog | Ecommerce Modules

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:

Method #2

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

<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; ?>’);

$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: