Dirty Butter Posted June 17, 2016 Share Posted June 17, 2016 My sitemap code has been extensively edited per Bsmither various directions. Since I am getting a timestamp error since upgrading to 6.0.12, I want to change back to original code temporarily until I can find my merge error. I know there's sitemap code in seo.class.php. Is there somewhere else there is sitemap code I need to revert temporarily? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17, 2016 Share Posted June 17, 2016 Other than the sitemap() function in seo.class.php, the private function at _site_map_link() at the bottom of the file is used by sitemap(). The only change to the seo.class.php file is dealing with the "Shop by Category" navigation array containing absolute URLs when it really shouldn't. I am not aware of any other place that "prepares" CubeCart for a site map. Maybe third-party? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 17, 2016 Author Share Posted June 17, 2016 OK Thanks. Trying to simplify without losing mod edits as well as tweaks you have provided. At least I know the issue has to be in just that one file. Appreciate it! Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 17, 2016 Author Share Posted June 17, 2016 Uh Oh - It's not that simple. I ended up using the stock seo.class.php file just to be sure it was working properly, and it's not. I get the sitemap.xml.gz file. The timestamp for all categories and documents is correct. BUT all product listings have 1969-12-31T18:33:32-06:00 as the timestamp. This is the same thing it was doing with my own edited code. Based on what you said about the Category and absolute value being the only thing different between 6.0.11 and 6.0.12, I reverted to my old 6.0.11 seo.class.php file, and it created a good sitemap. So, is the problem with the new code itself, or likely to be some edit I have in place that conflicts with the new code? I've attached a copy of my 6.0.11 file. NOTGOODseo.class.php See comment below. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 18, 2016 Share Posted June 18, 2016 I see two sections of code. The first section stops abruptly. Is the second section supposed to be a stock CC6012 file contents? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 18, 2016 Author Share Posted June 18, 2016 seo.class.php I've made so many swaps in the last hour, who knows what I did. I've uploaded what is working again. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 18, 2016 Author Share Posted June 18, 2016 I double checked everything today, hoping with fresh eyes I would spot the cause - but no luck. If I use the clean 6.0.12 seo.class.php file, I get the wrong timestamp on the product url's. If I use my 6.0.11 file instead, I get a good sitemap.xml. The 6.0.12 code change is merged correctly in gui.class.php, so that's not the issue. I just tried it with the CC demo store, and it created a sitemap with the same timestamp issue. This is a bug. https://github.com/cubecart/v6/issues/1141 Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 20, 2016 Share Posted June 20, 2016 Please post the code that is yours from the file seo.class.php, near line (for CC6012) 722. The stock CC6012 line is: $this->_sitemap_link(array('key' => $key, 'id' => $id), (isset($record['updated']) && !empty($record['updated'])) ? (int)$record['updated'] : time(), $type); The suggested replacement is: $this->_sitemap_link(array('key' => $key, 'id' => $id), (isset($record['updated']) && !empty($record['updated'])) ? strtotime($record['updated']) : time(), $type); With your edits and an explanation of what you are trying to accomplish, we can create an edit for CC6012 that should work for you incorporating your intentions. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 20, 2016 Author Share Posted June 20, 2016 Just to see what would happen, I substituted your repaired code for the bad one. The only part I did not use from my edits was the part that did not use the .gz form of the sitemap. It appears to create a sitemap.xml.gz that has the last update date for each item - not the date when the sitemap was created (today). I checked the old 6.0.11 version sitemap, and it has the current date as of that sitemap for ALL products. (I keep all products in the sitemap - sold or not, since part of our purpose is to help people find lovies, not just sell them.) The other edits in MY seo.class.php were to increase the accuracy of the sitemap by better obeying the robots.txt file. Of course there are some mod edits, but they don't seem to have anything to do with the sitemap.xml, as far as I can tell. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 20, 2016 Share Posted June 20, 2016 The date of an item's last update was (apparently) always the intention. Quote Link to comment Share on other sites More sharing options...
jpayam Posted June 20, 2016 Share Posted June 20, 2016 I have same problem , after upgrading from 6.0.11 to 6.012 we have time-stamp error on sitemap for some products timestamp is : <lastmod>1970-01-01T00:33:34+00:00</lastmod> Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 20, 2016 Author Share Posted June 20, 2016 I am now using My version of seo.class.php with your REVISED line for the sitemap, and it's working properly - other than it not putting the current timestamp. It's always been current timestamp before. I'll have to get busy opening and saving our oldest items, so the timestamp will be recent. I did find, when I sorted the Products list by last updated - there were about a dozen listings (some in stock) that had all zeros as the time! I could not get a valid sitemap.xml until I opened and then saved all of those. 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.