From 850a6789763a5ae6b96da418b6111922d3016180 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 12 Dec 2017 17:04:25 +0100 Subject: [PATCH] Add ean13 if available and ".html" suffix --- modules/ant_canonical/ant_canonical.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/ant_canonical/ant_canonical.php b/modules/ant_canonical/ant_canonical.php index f1257b1d..c2a2a9a4 100644 --- a/modules/ant_canonical/ant_canonical.php +++ b/modules/ant_canonical/ant_canonical.php @@ -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; } /**