diff --git a/gshoppingflux/gshoppingflux.php b/gshoppingflux/gshoppingflux.php index 92a9b2a..e565f51 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) { + $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']; @@ -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";