prestanesia Posted December 12, 2012 Share Posted December 12, 2012 (edited) I just notice that the generated product URL in the sitemap.xml is not in friendly format (altho the friendly url in back office is activated), so, instead <url> <loc>http://domain.com/store/music-ipods/1-ipod-nano.html</loc> <priority>0.6</priority> <lastmod>2012-12-11</lastmod> <changefreq>weekly</changefreq> </url> it display <url> <loc>http://domain.com/index.php?id_product=1&controller=product</loc> <priority>0.6</priority> <lastmod>2012-12-11</lastmod> <changefreq>weekly</changefreq> </url> my fix is modifying gsitemap.php in line 209 and change it to: $tmpLink = $this->context->link->getProductLink((int)($product['id_product']), $product['link_rewrite'], $product['category'], $product['ean13'], (int)($product['id_lang']),null,0,true); Edited December 12, 2012 by prestanesia (see edit history) 2 Link to comment Share on other sites More sharing options...
Muad'Dib Posted December 12, 2012 Share Posted December 12, 2012 Hello, Many thanks for pointing this out, I kind of missed that one! From that I made some searches to find out that was known already and even reported. Anyway I am very grateful that you posted it or I would have for sure missed it for quite a long time, and google would have spanked me I personally I also changed the sql query to make it 1 single language because I could not find a proper way to start with one specific language. For reference in case someone would want to do the same: replace l.148 - $langs = Language::getLanguages(); by l.148 + $langs[] = Language::getLanguage(<replace by id of the language you want>); then replace l.185 - WHERE l.`active` = 1 by l.185 + WHERE l.id_lang = <replace by the id of the language you want> Hope this helps & See you! Cheers! Link to comment Share on other sites More sharing options...
go2pub Posted December 15, 2012 Share Posted December 15, 2012 Nice spot, I hadn't noticed it. Thanks Link to comment Share on other sites More sharing options...
nellybongo Posted December 16, 2012 Share Posted December 16, 2012 Brilliant spot that one, well done Link to comment Share on other sites More sharing options...
Hugo06 Posted December 18, 2012 Share Posted December 18, 2012 Thank you VERY much for this post ! Link to comment Share on other sites More sharing options...
guest* Posted February 4, 2013 Share Posted February 4, 2013 Hi, many thanks. This solves the problem of product controller, but how to eliminate the EAN in product link ? I tried to deleted in the line code $product['ean13'] But than again the products are shown the link again with productcontroller instead of friendly. Link to comment Share on other sites More sharing options...
guest* Posted February 10, 2013 Share Posted February 10, 2013 Please, does nobody have a solution for the EAN problem? My shop is still waiting to go online in version PS 1.5.x EDIT: problem solved - http://www.prestasho...ost__p__1096508 Link to comment Share on other sites More sharing options...
SteliosAl Posted February 11, 2013 Share Posted February 11, 2013 Hello, Many thanks for pointing this out, I kind of missed that one! From that I made some searches to find out that was known already and even reported. Anyway I am very grateful that you posted it or I would have for sure missed it for quite a long time, and google would have spanked me I personally I also changed the sql query to make it 1 single language because I could not find a proper way to start with one specific language. For reference in case someone would want to do the same: replace l.148 - $langs = Language::getLanguages(); by l.148 + $langs[] = Language::getLanguage(<replace by id of the language you want>); then replace l.185 - WHERE l.`active` = 1 by l.185 + WHERE l.id_lang = <replace by the id of the language you want> Hope this helps & See you! Cheers! will this create the sitemap in one language only? thanks Link to comment Share on other sites More sharing options...
SteliosAl Posted February 11, 2013 Share Posted February 11, 2013 I just notice that the generated product URL in the sitemap.xml is not in friendly format (altho the friendly url in back office is activated), so, instead <url> <loc>http://domain.com/store/music-ipods/1-ipod-nano.html</loc> <priority>0.6</priority> <lastmod>2012-12-11</lastmod> <changefreq>weekly</changefreq> </url> it display <url> <loc>http://domain.com/index.php?id_product=1&controller=product</loc> <priority>0.6</priority> <lastmod>2012-12-11</lastmod> <changefreq>weekly</changefreq> </url> my fix is modifying gsitemap.php in line 209 and change it to: $tmpLink = $this->context->link->getProductLink((int)($product['id_product']), $product['link_rewrite'], $product['category'], $product['ean13'], (int)($product['id_lang']),null,0,true); i replaced the code with your code, when i update sitemap i get this error:[PrestaShop] Fatal error in module gsitemap: Call to a member function addChild() on a non-object any ideas?thanks Link to comment Share on other sites More sharing options...
be_tnt Posted February 15, 2013 Share Posted February 15, 2013 (edited) Hello, I used as fix (line 208): $tmpLink = Configuration::get('PS_REWRITING_SETTINGS') ? $this->context->link->getProductLink((int)($product['id_product']), $product['link_rewrite'], $product['category'], $product['ean13'], (int)($product['id_lang']),null,0,true) : $this->context->link->getProductLink((int)($product['id_product']), $product['link_rewrite'], $product['category'], $product['ean13'], (int)($product['id_lang'])); Edited February 15, 2013 by be_tnt (see edit history) Link to comment Share on other sites More sharing options...
Whispar1 Posted March 9, 2013 Share Posted March 9, 2013 Thanks for the info be_tnt and the heads up from prestanesia I tried your code and I got the same error as Stelios did with the OP's code. Any ideas? Link to comment Share on other sites More sharing options...
zabojad Posted May 1, 2013 Share Posted May 1, 2013 Hi ! With the above fixes, products have now friendly URLs in the sitemap.xml. However the classic pages (news products, ...) don't. How to fix it for them too ? Thanks Tom Link to comment Share on other sites More sharing options...
ant.jullien Posted May 23, 2013 Share Posted May 23, 2013 I have the same problem like zabojad. The above fixes, products have now friendly URLs but the classic pages (news products, best-sales...) don't Does anyone have solution ? Thanks Link to comment Share on other sites More sharing options...
zabojad Posted May 23, 2013 Share Posted May 23, 2013 Simply update the Google sitemap module in your module list. I think the current version is something like 2.1. After having updated, everything was fine with the sitemap (it even generate one sitemap per language of your prestashop). Link to comment Share on other sites More sharing options...
ant.jullien Posted May 23, 2013 Share Posted May 23, 2013 Sadly the update doesn't work Where can I download the module updated ? Thanks for your help Link to comment Share on other sites More sharing options...
Arnaud Drieux Posted July 16, 2014 Share Posted July 16, 2014 (edited) Bonjour, je me permet de venir poser ma question ici car j'ai un gros soucis. le topic que j'ai ouvert à ce sujet Aujourd'hui il m'est impossible d'avoir des urls corrects et ce, depuis la migration d'une 1.5 vers la 1.6.0.6. Même après avoir fait un test de migration vers la 1.6.0.8, les urls sont toujours problèmatiques, voici quelques exemples : <loc><![CDATA[www.urldemonsite.fr/6-Array-3557640149011.html]]></loc> <loc><![CDATA[www.urldemonsite.fr/9-Array-3557640149028.html]]></loc> <image:loc><![CDATA[http://www.urldemonsite.fr/8538/Array.jpg]]></image:loc> <image:loc><![CDATA[http://www.urldemonsite.fr/8547/Array.jpg]]></image:loc> Je ne sais plus quoi faire...merci d'avance EDIT: Cela provenait d'un override de la class Meta.php et de la re-déclaration de la function __construct() dans mon override de Product.php Edited July 18, 2014 by arnaud1900 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts