Post by ziatakis » Fri May 29, 2020 4:44 pm

Hi,
OC 3.0.3.1 "Canonical" Not working on product, category, information, manufacturer

Sample of code in controller/product/product.php
$this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical');

Sample of code in controller/product/category.php
if ($page == 1) {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id']), 'canonical');
} else {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. $page), 'canonical');
}

Any suggestions?

New member

Posts

Joined
Mon Oct 09, 2017 11:29 pm

Post by JNeuhoff » Fri May 29, 2020 5:56 pm

Link canonicals are working fine. The code is correct. What exact error do you experience? Website URL?

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by ziatakis » Fri May 29, 2020 6:05 pm

JNeuhoff wrote:
Fri May 29, 2020 5:56 pm
Link canonicals are working fine. The code is correct. What exact error do you experience? Website URL?
https://www.e-ziatakis.gr/
you can see that canonical is missing from all pages

New member

Posts

Joined
Mon Oct 09, 2017 11:29 pm

Post by JNeuhoff » Fri May 29, 2020 6:35 pm

This is an issue most likely caused by your web theme, not by OpenCart 3.0.x releases. Please consider a more standard compliant web theme.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by ziatakis » Fri May 29, 2020 6:47 pm

JNeuhoff wrote:
Fri May 29, 2020 6:35 pm
This is an issue most likely caused by your web theme, not by OpenCart 3.0.x releases. Please consider a more standard compliant web theme.
We have cloned the site to localhost, and everything works fine.
Also we have tested the current theme on clean install, and works ok.

We have also installed seopackpro, but still no luck

New member

Posts

Joined
Mon Oct 09, 2017 11:29 pm

Post by ziatakis » Fri May 29, 2020 7:11 pm

ziatakis wrote:
Fri May 29, 2020 6:47 pm
JNeuhoff wrote:
Fri May 29, 2020 6:35 pm
This is an issue most likely caused by your web theme, not by OpenCart 3.0.x releases. Please consider a more standard compliant web theme.
We have cloned the site to localhost, and everything works fine.
Also we have tested the current theme on clean install, and works ok.

We have also installed seopackpro, but still no luck
After 3 days of searching finally we found it. We accidentally deleted the following from header.twig

{% for link in links %}
<link href="{{ link.href }}" rel="{{ link.rel }}" />
{% endfor %}

Now everything is ok.

New member

Posts

Joined
Mon Oct 09, 2017 11:29 pm
Who is online

Users browsing this forum: No registered users and 15 guests