[PrestaShop] Sitemaps exceeds 100,000 urls

PrestaShop Modules including WordPress & phpBB Integration.
monstreyhans
Posts: 6
Joined: Wed Apr 02, 2008 2:07 pm

[PrestaShop] Sitemaps exceeds 100,000 urls

Postby monstreyhans » Tue Sep 04, 2012 12:26 am

I have a problem whit sitemap.php. I have more than 100.000 URL"s and google accept only 50.000 URL's in one sitemap-file. How can i split it in different sitemap-files.

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [PrestaShop] Sitemaps exceeds 100,000 urls

Postby inveo » Wed Sep 05, 2012 11:38 am

Please make a second copy of sitemaps/products.php file and put it to
the same folder.

Then open-up both files and change the line:

Code: Select all

$result = Db::getInstance()->ExecuteS("SELECT p.`id_product`,
p.`date_add`, p.`date_upd` FROM ".TABLE_PRODUCT." p,
".TABLE_PRODUCT_LANG." pl WHERE p.`active` = '1' AND pl.`id_product` =
p.`id_product` AND pl.`id_lang` = '".$langId."' AND p.`id_product` IN
(SELECT cp.`id_product` FROM ".TABLE_CATEGORY_GROUP." cg LEFT JOIN
".TABLE_CATEGORY_PRODUCT." cp ON (cp.`id_category` = cg.`id_category`)
WHERE cg.`id_group` = 1) ORDER BY p.`id_product` DESC");


to (in the first file):

Code: Select all

$result = Db::getInstance()->ExecuteS("SELECT p.`id_product`,
p.`date_add`, p.`date_upd` FROM ".TABLE_PRODUCT." p,
".TABLE_PRODUCT_LANG." pl WHERE p.`active` = '1' AND pl.`id_product` =
p.`id_product` AND pl.`id_lang` = '".$langId."' AND p.`id_product` IN
(SELECT cp.`id_product` FROM ".TABLE_CATEGORY_GROUP." cg LEFT JOIN
".TABLE_CATEGORY_PRODUCT." cp ON (cp.`id_category` = cg.`id_category`)
WHERE cg.`id_group` = 1) ORDER BY p.`id_product` DESC LIMIT 0,40000");


to (in the second file):

Code: Select all

$result = Db::getInstance()->ExecuteS("SELECT p.`id_product`,
p.`date_add`, p.`date_upd` FROM ".TABLE_PRODUCT." p,
".TABLE_PRODUCT_LANG." pl WHERE p.`active` = '1' AND pl.`id_product` =
p.`id_product` AND pl.`id_lang` = '".$langId."' AND p.`id_product` IN
(SELECT cp.`id_product` FROM ".TABLE_CATEGORY_GROUP." cg LEFT JOIN
".TABLE_CATEGORY_PRODUCT." cp ON (cp.`id_category` = cg.`id_category`)
WHERE cg.`id_group` = 1) ORDER BY p.`id_product` DESC LIMIT
40000,80000");