Jump to content
ruden

XML Sitemap Generator

Recommended Posts

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

 

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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)


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites

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... ?

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

If run sitemap.php, then a new xml files will be generated

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

every so often on the control panel show this alert WARNING_SITEMAP_INDEX_XML_EXIST

What is this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×