ruden Posted January 4, 2020 Share Posted January 4, 2020 XML Sitemap Generator For all version osCommerce create an XML sitemap for the products, categories and manufacturers, that can be submitted to Google, Bing. Install --------- Unzip the archive and upload the files on server. In admin/includes/functions/general.php Find function tep_redirect($url) { global $logger; Add after // start add-on xml sitemap generator global $current_page; if (in_array($current_page, ['categories.php', 'manufacturers.php'])) { if (file_exists(DIR_FS_CATALOG . 'sitemap-index.xml')) { @unlink(DIR_FS_CATALOG . 'sitemap-index.xml'); } } // end add-on xml sitemap generator Using -------- Sign in to Google Search Console or Bing Webmaster Tools and add sitemap URL http://example.com/sitemap.php Fredi and domiosc 1 1 Quote Link to comment Share on other sites More sharing options...
domiosc Posted January 4, 2020 Share Posted January 4, 2020 Thanks ruden Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted January 4, 2020 Share Posted January 4, 2020 1 hour ago, ruden said: XML Sitemap Generator For all version osCommerce create an XML sitemap for the products, categories and manufacturers, that can be submitted to Google, Bing. Install --------- Unzip the archive and upload the files on server. In admin/includes/functions/general.php Find function tep_redirect($url) { global $logger; Add after // start add-on xml sitemap generator global $current_page; if (in_array($current_page, ['categories.php', 'manufacturers.php'])) { if (file_exists(DIR_FS_CATALOG . 'sitemap-index.xml')) { @unlink(DIR_FS_CATALOG . 'sitemap-index.xml'); } } // end add-on xml sitemap generator Using -------- Sign in to Google Search Console or Bing Webmaster Tools and add sitemap URL http://example.com/sitemap.php Could this not be done without core code changes? @burt Quote Link to comment Share on other sites More sharing options...
Omar_one Posted January 4, 2020 Share Posted January 4, 2020 15 minutes ago, LeeFoster said: Could this not be done without core code changes? @burt @LeeFoster If I remember right @burt has build XML files system for Google Webmasters, Bing and others ZERO core code changes (2015) Quote Get the latest Responsive osCommerce CE (community edition) here . Link to comment Share on other sites More sharing options...
Denzel Posted January 14, 2020 Share Posted January 14, 2020 I have a question: The Archive are the sitmap.php and a function file ? The changes in general.php ( which easily can be modded as a hook ) deletes automaticly the sitemap-index, if I request categories or manufacturers? So, if I do something automaticly, why not execute sitemap.php after saving a product and create an actual sitemap, instead of deleting the map, which google is looking for ? Have I misunderstood something ? Quote Link to comment Share on other sites More sharing options...
ruden Posted January 14, 2020 Author Share Posted January 14, 2020 1 hour ago, Denzel said: The changes in general.php ( which easily can be modded as a hook ) Yes, I will do so, for compatibility v2.3.x addon is added https://apps.oscommerce.com/p9Yyp&hook-system 1 hour ago, Denzel said: why not execute sitemap.php after saving a product and create an actual sitemap, Initially, it worked, but if a lot of products all terribly slowed down. A link will be added to generate the map in dashboard (module security check) Quote Link to comment Share on other sites More sharing options...
Denzel Posted January 14, 2020 Share Posted January 14, 2020 But why deleting the sitemap without telling someone while accessing categories or manufacturer ? Google will download the sitemap sometime you don't know, but if they find nothing... ? Quote Link to comment Share on other sites More sharing options...
ruden Posted January 14, 2020 Author Share Posted January 14, 2020 Why should categories be opened first, xml producer, and then sitemap-index.xml Cannot open categories or manufacturer xml without running sitemap.php Google will always run the file sitemap.php and read sitemap-index.xml If you specify sitemap-index.xml in the Google search console, it will not work. Quote Link to comment Share on other sites More sharing options...
ruden Posted January 14, 2020 Author Share Posted January 14, 2020 If run sitemap.php, then a new xml files will be generated Quote Link to comment Share on other sites More sharing options...
sntmods1 Posted January 17, 2020 Share Posted January 17, 2020 I've received this error while testing sitemap.php, any idea? Im using CE Phoenix 1.0.4 I've tested it with PHP 5.4, 7.0 and 7.1 Fatal error: Uncaught Error: Call to undefined function mysqli_fetch_all() in /xxxx/xxxxxx/public_html/catalog/includes/functions/sitemap.php:14 Stack trace: #0 /xxxx/xxxxxx/public_html/catalog/sitemap.php(142): tep_db_fetch_all(Object(mysqli_result)) #1 {main} thrown in /xxxx/xxxxxx/public_html/catalog/includes/functions/sitemap.php on line 14 Quote Link to comment Share on other sites More sharing options...
ruden Posted January 17, 2020 Author Share Posted January 17, 2020 (edited) add fix addon updated Edited January 17, 2020 by ruden Fredi 1 Quote Link to comment Share on other sites More sharing options...
sntmods1 Posted January 17, 2020 Share Posted January 17, 2020 thats fixed, good job! Quote Link to comment Share on other sites More sharing options...
domiosc Posted April 19, 2020 Share Posted April 19, 2020 every so often on the control panel show this alert WARNING_SITEMAP_INDEX_XML_EXIST What is this? Quote Link to comment Share on other sites More sharing options...
fire2hot Posted May 5, 2020 Share Posted May 5, 2020 @ruden How can i make xml file that googel find my images in the sitemap? let me know. Greetings Paul Quote Link to comment Share on other sites More sharing options...
mendoh Posted August 12, 2020 Share Posted August 12, 2020 On 1/14/2020 at 3:18 PM, ruden said: If run sitemap.php, then a new xml files will be generated First of all, thanks for your writing this nice add-on. I installed it and tested it and it apparently works fine on my multi-language website (4 active languages): I could verify that it actually generates all the different .xml files for the various languages that are active on my website. Checking the actual .xml files in a different language than English, however, gives me bad news: I could realize that the file listed as a Spanish product sitemap actually contains a product sitemap in French. French product sitemap is in French, however, the same happens with all the remaining sitemap files for all the other available languages: they are all in French, despite the default language is set to English. In layman's terms, it seems to randomly take one among the available languages and that language stays the same for all product sitemaps regardless of the language. Would you know how to fix the above issue? Quote Link to comment Share on other sites More sharing options...
ruden Posted August 13, 2020 Author Share Posted August 13, 2020 @mendoh Give a link to your site. Quote Link to comment Share on other sites More sharing options...
mendoh Posted August 13, 2020 Share Posted August 13, 2020 2 hours ago, ruden said: @mendoh Give a link to your site. Hello Ruden, thanks. The multi-language website where I am trying to use your add-on is this: netgun.store/webshop Quote Link to comment Share on other sites More sharing options...
ruden Posted August 13, 2020 Author Share Posted August 13, 2020 In file sitemap.php this code if (SEARCH_ENGINE_FRIENDLY_URLS == 'true' || (defined('SEO_ENABLED') && SEO_ENABLED == 'true')) { $languages_array = tep_db_query("SELECT code FROM languages"); while ($languages = tep_db_fetch_array($languages_array)) { $file_extension = ($languages['code'] == DEFAULT_LANGUAGE ? '' : '-' . $languages['code']); create_sitemap($file_extension . '.xml'); create_sitemap_catalog($doc, $root, $file_extension . '.xml'); } } else { create_sitemap(); create_sitemap_catalog($doc, $root); } replace with //if (SEARCH_ENGINE_FRIENDLY_URLS == 'true' || (defined('SEO_ENABLED') && SEO_ENABLED == 'true')) { $languages_array = tep_db_query("SELECT code FROM languages"); while ($languages = tep_db_fetch_array($languages_array)) { $file_extension = ($languages['code'] == DEFAULT_LANGUAGE ? '' : '-' . $languages['code']); create_sitemap($file_extension . '.xml'); create_sitemap_catalog($doc, $root, $file_extension . '.xml'); } //} else { // create_sitemap(); // create_sitemap_catalog($doc, $root); //} OR If you know what constant controls the inclusion of your SEO add-on, then just replace SEO_ENABLED with [YOUR_SEO_ADDON_ENABLED] Quote Link to comment Share on other sites More sharing options...
mendoh Posted August 14, 2020 Share Posted August 14, 2020 5 hours ago, ruden said: //if (SEARCH_ENGINE_FRIENDLY_URLS == 'true' || (defined('SEO_ENABLED') && SEO_ENABLED == 'true')) { $languages_array = tep_db_query("SELECT code FROM languages"); while ($languages = tep_db_fetch_array($languages_array)) { $file_extension = ($languages['code'] == DEFAULT_LANGUAGE ? '' : '-' . $languages['code']); create_sitemap($file_extension . '.xml'); create_sitemap_catalog($doc, $root, $file_extension . '.xml'); } //} else { // create_sitemap(); // create_sitemap_catalog($doc, $root); //} 😮 After replacing the file section as suggested, the add-on does not work any more and I am getting a 404 error when running the sitemap.php file, even if the file is actually present... Quote Link to comment Share on other sites More sharing options...
mendoh Posted August 14, 2020 Share Posted August 14, 2020 I have noticed that a sitemap for the language in which the site is being browsed is generated and that language is extended to all the remaining sitemaps for all the other available languages, that is, although you actually get as many different sitemap files as the available languages, all of those files only show the one site language which was on at the time the sitemap.php file was run... Quote Link to comment Share on other sites More sharing options...
ruden Posted August 14, 2020 Author Share Posted August 14, 2020 Which SEO add-on is installed in the store? Quote Link to comment Share on other sites More sharing options...
mendoh Posted August 14, 2020 Share Posted August 14, 2020 Header Tags Seo + Ultimate Seo Urls Quote Link to comment Share on other sites More sharing options...
ruden Posted August 14, 2020 Author Share Posted August 14, 2020 Unfortunately this doesn't work with Ultimate SEO URLs, due to the language session. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.