prestashop: manufacturer page not showing canonical url

 

 

files of interest:

  • /var/www/html/msupply/themes/classic/templates/catalog/listing/manufacturer.tpl
  • /var/www/html/msupply/controllers/front/listing/ManufacturerController.php
  • /var/www/html/msupply/classes/Manufacturer.php

 

My hope was to define the manufacturer_url to add it as a canonical link, as the lack of it has SEO implications, but the URL is not defined on the classes/Manufacturer.php file.

 

 

update: 2023-01-08

 

go to: ../themes/classic/templates/catalog/listing/manufacturer.tpl for some reason the {$brand.url} variable returns an empty value so we'll get the value using another method.

so just replace

<link rel="canonical" href="{$brand.url}">

with

<link rel="canonical" href="{$link->getManufacturerLink({$manufacturer.id})}">

 

 

 

update: 2023-01-08

there was an additional problem when paginating the results:

 

{if {$listing.pagination.current_page} == 1}
  <link rel="canonical" href="{$link->getManufacturerLink({$manufacturer.id})}">
{/if}



{if {$listing.pagination.current_page} > 1}
  <link rel="canonical" href="{$link->getManufacturerLink({$manufacturer.id})}?page={$listing.pagination.current_page}">
{/if}

 

Leave a Reply

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