Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Sitemap

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 03-23-2015, 10:02 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Sitemap

It seems that either the XML sitemap for X-Cart 5 is not functioning, or I don't understand it's normal operation.

I have enabled the sitemap module on several X-Cart 5 sites, both my test sites and live client sites. The XML file is generated on the fly by PHP. The file exists, the path works, but the sitemap is blank. Am I missing a step to populate the sitemap?

Here is one of my test stores: http://xcartnext.com/?target=sitemap

Here is the Official X-Cart demo store:
http://demostore.x-cart.com/?target=sitemap
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #2  
Old 03-23-2015, 11:16 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Sitemap

So then it doesn't work
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
totaltec (03-23-2015)
  #3  
Old 03-23-2015, 11:50 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Sitemap

Quote:
Originally Posted by cflsystems
So then it doesn't work
You are correct sir!

Digging into this issue, (And I have discovered that it goes back at least to XC 5.1., I find that the root cause is this method:

XLite/Module/CDev/XMLSitemap/Controller/Customer/Sitemap.php
Code:
public function processRequest() { $generator = \XLite\Module\CDev\XMLSitemap\Logic\SitemapGenerator::getInstance(); if (!$generator->isGenerated() || $generator->isObsolete()) { $generator->generate(); } $index = intval(\XLite\Core\Request::getInstance()->index); $content = $index ? $generator->getSitemap($index) : $generator->getIndex(); $this->displayContent($content); }

Line 50: $index = intval(\XLite\Core\Request::getInstance()->index);

This^ always returns a 0 in my tests, and it needs to be a 1. The xml files are saved in the var/data directory and in every case I have examined (about a dozen) the file is invariably xmlsitemap.1.xml. Never 0.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #4  
Old 03-23-2015, 10:26 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Sitemap

It is not empty on the demo store.

The XML at http://demostore.x-cart.com/?target=sitemap says that the location of the XML sitemap file is http://demostore.x-cart.com/cart.php?target=sitemap&index=1

As far as I see it does list pages properly.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote

The following 2 users thank qualiteam for this useful post:
Ksenia (03-25-2015), totaltec (03-24-2015)
  #5  
Old 03-24-2015, 03:40 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Sitemap

Alex,
Thank you very much for clarifying! I did not understand the function of the sitemap index. I see now that it is useful when stores have over 50,000 URL's. While I don't think this is necessary for the majority of stores, having it built this way from the beginning is a great plan from what I can tell.

This article educated me: https://www.siteground.com/tutorials/sitemap/multiple_sitemaps.htm

Again thanks, this was due to my ignorance of this more complex setup.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
qualiteam (03-24-2015)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:04 PM.

   

 
X-Cart forums © 2001-2020