PRO TIPS (FREE) – ADDING CANONICAL URLS TO YOUR OPENCART PAGES

Are you running a website with opencart? Do know about why canonical tag required for your website? Well then, below you can find easy solutions for your requirement.

OpenCart is an open source e-commerce software used to build online stores.Despite its popularity, some of its missing features are glaring, especially when it comes to SEO.  OpenCart does implement the rel=”canonical” tag on its product pages. However, there’s no canonical tag on any of the category pages or the all-important homepage. If you install OpenCart without fixing this problem, a Google site:yourdomain.com search will show a million variations of each category diluting the results, “link juice”, and earning relegation to the “See this search with duplicate pages”.

What Is rel=”canonical” tag and Why should required for website pages.

Read more from https://support.google.com/webmasters/answer/139066?hl=en&rd=1

Find below relatively easy solution,

1) Edit your catalog/controller/product/category.php file

2) Find this line:

if ($category_info) {

3) Immediately after it, add the following lines:

$can_url=$this->url->link(“product/category”,”path=”.$this->request->get[‘path’]); $this->document->addLink($can_url,”canonical”);

4) Now edit catalog/controllers/common/home.php

5) Find this line:

$this->document->setDescription($this->config->get(‘config_meta_description’));

6) Immediately after it add:

$can_url=$this->url->link(‘common/home’); $can_url=str_replace(‘index.php?route=common/home’, ”, $can_url); $this->document->addLink($can_url,’canonical’);

That’s It!!!You have canonical urls!