Add ean13 if available and ".html" suffix

This commit is contained in:
Michael RICOIS 2017-12-12 17:04:25 +01:00
parent 0a6a26d716
commit 850a678976

View File

@ -79,8 +79,16 @@ class Ant_Canonical extends Module
global $cookie;
$product = new Product($id);
return $this->getLinkRewriteCategory($product->id_category_default, true)
$link = $this->getLinkRewriteCategory($product->id_category_default, true)
.'/'.$id.'-'.$product->link_rewrite[$cookie->id_lang];
if (!empty($product->ean13)) {
$link .= '-' . $product->ean13;
}
$link .= '.html';
return $link;
}
/**