There was a bug in 2.3.0.2 where some of the canonical tags were missing if the category URL had page in.
https://github.com/opencart/opencart/issues/4637
In catalog/controller/product/category.php find.
Code: Select all
if ($page == 1) {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'], true), 'canonical');
} elseif ($page == 2) {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'], true), 'prev');
} else {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page - 1), true), 'prev');
}
if ($limit && ceil($product_total / $limit) > $page) {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1), true), 'next');
}
And replace with.
Code: Select all
if ($page == 1) {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id']), 'canonical');
} elseif ($page == 2) {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. $page), 'canonical');
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id']), 'prev');
} else {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. $page), 'canonical');
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page - 1)), 'prev');
}
if ($limit && ceil($product_total / $limit) > $page) {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1)), 'next');
}