From 13e3956136179dafe504c8c45ac45e215f678d5c Mon Sep 17 00:00:00 2001 From: eballet-baz Date: Thu, 19 Dec 2024 09:16:16 +0100 Subject: [PATCH 1/2] Fix #118 - Include new attribute --- gshoppingflux/gshoppingflux.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gshoppingflux/gshoppingflux.php b/gshoppingflux/gshoppingflux.php index 92a9b2a..a498873 100644 --- a/gshoppingflux/gshoppingflux.php +++ b/gshoppingflux/gshoppingflux.php @@ -2610,6 +2610,7 @@ private function getItemXML($product, $lang, $id_curr, $id_shop, $combination = $xml_googleshopping = ''; $id_lang = (int) $lang['id_lang']; $title_limit = 70; + $short_title_limit = 65; $description_limit = 4990; $languages = Language::getLanguages(); $tailleTabLang = sizeof($languages); @@ -2642,6 +2643,7 @@ private function getItemXML($product, $lang, $id_curr, $id_shop, $combination = // Product name $title_crop = $product['name']; + $short_title_crop = $product['name']; // Product color attribute, if any if (!empty($product['color'])) { @@ -2662,6 +2664,11 @@ private function getItemXML($product, $lang, $id_curr, $id_shop, $combination = $title_crop = Tools::substr($title_crop, 0, strrpos($title_crop, ' ')); } + if (Tools::strlen($short_title_crop) > $short_title_limit) { + $title_crop = Tools::substr($short_title_crop, 0, $short_title_limit - 1); + $title_crop = Tools::substr($short_title_crop, 0, strrpos($short_title_crop, ' ')); + } + // Description type if ($this->module_conf['description'] == 'long') { $description_crop = $product['description']; @@ -2689,6 +2696,7 @@ private function getItemXML($product, $lang, $id_curr, $id_shop, $combination = $xml_googleshopping .= '' . "\n"; $xml_googleshopping .= '' . $product['gid'] . '' . "\n"; $xml_googleshopping .= '' . "\n"; + $xml_googleshopping .= '' . "\n"; $xml_googleshopping .= '' . "\n"; $xml_googleshopping .= 'linkencode($product_link) . ']]>' . "\n"; From 223ff20690c2be8788976b84e6d60f748728e829 Mon Sep 17 00:00:00 2001 From: eballet-baz Date: Thu, 19 Dec 2024 09:19:23 +0100 Subject: [PATCH 2/2] Fix #118 - Include new attribute --- gshoppingflux/gshoppingflux.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gshoppingflux/gshoppingflux.php b/gshoppingflux/gshoppingflux.php index a498873..e565f51 100644 --- a/gshoppingflux/gshoppingflux.php +++ b/gshoppingflux/gshoppingflux.php @@ -2665,10 +2665,10 @@ private function getItemXML($product, $lang, $id_curr, $id_shop, $combination = } if (Tools::strlen($short_title_crop) > $short_title_limit) { - $title_crop = Tools::substr($short_title_crop, 0, $short_title_limit - 1); - $title_crop = Tools::substr($short_title_crop, 0, strrpos($short_title_crop, ' ')); + $short_title_crop = Tools::substr($short_title_crop, 0, $short_title_limit - 1); + $short_title_crop = Tools::substr($short_title_crop, 0, strrpos($short_title_crop, ' ')); } - + // Description type if ($this->module_conf['description'] == 'long') { $description_crop = $product['description'];