Zen Cart Logo
Forums / All Other Contributions/Addons / RSS Feed - Version: 2.1.6 <pubDate> not correct

RSS Feed - Version: 2.1.6 <pubDate> not correct

Views: 906

Results 1 to 3 of 3
30 Sep 2012, 2:01 PM
#1
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

RSS Feed - Version: 2.1.6 <pubDate> not correct

Hi

I'm having a problem with my rss feed. When I click on (for example) new products feed, I notice the publish date is showing as Thursday, December 01, 2011 1:00 AM. Even recently added products are showing this date.

The only feeds not stuck on the wrong date are the feeds generated for each individual product page.

It would not matter so much except when importing the feed to facebook using rss graffiti I have to set the import date back too far in order to get the feed to import, but that results in too many older products being included instead of the recently added items I really want.

I have reinstalled the mod and also checked the file permissions. In admin I tried resetting time to live and Feed Cache Time but those did not help.

<lastBuildDate> is fine and is showing a date as of last night, the 29th. The problem seems to be with the <pubDate>

Any ideas what could be the problem?

thanks

1 Oct 2012, 1:09 PM
#2
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

Re: RSS Feed - Version: 2.1.6 <pubDate> not correct

Apparently I'm not the only one who has noticed this. I found another thread stating the same type of problem.

http://www.zen-cart.com/showthread.php?198813-RSS-Feed-out-of-date

I also found another cart with the rss feed showing the wrong date. The dates of

Thursday, December 01, 2011 1:00:00 AM
Sunday, January 01, 2012 1:00:00 AM

are both before the cart was even built.

Has anyone else noticed it with their feed?

24 Nov 2013, 1:15 PM
#3
webchills avatar

webchills

Zen Follower

Join Date:
Sep 2005
Location:
Austria
Posts:
99
Plugin Contributions:
1

Re: RSS Feed - Version: 2.1.6 <pubDate> not correct

includes/modules/pages/rss_feed/header_php.php

Find around line 356:

$sql_products = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, GREATEST(p.products_date_added, IFNULL(p.products_last_modified, 0)) AS products_date, p.master_categories_id, p.products_price_sorter AS price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                       FROM " . TABLE_PRODUCTS . " p

This code returns the products_date wrong.

so change to:

$sql_products = "SELECT DISTINCT p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_date_added, p.products_last_modified, p.master_categories_id, p.products_price_sorter AS price, p.products_tax_class_id, p.products_quantity, p.products_model, p.products_weight, p.manufacturers_id, m.manufacturers_name, r.reviews_rating
                       FROM " . TABLE_PRODUCTS . " p

And then change around line 512 from products_date to products_date_added:

Old:

$rss->rss_feed_item($products->fields['products_name'],
                          $link,
                          array('url' => $link, 'PermaLink' => true),
                          date('r', strtotime($products->fields['products_date'])),

New:

$rss->rss_feed_item($products->fields['products_name'],
                          $link,
                          array('url' => $link, 'PermaLink' => true),
                          date('r', strtotime($products->fields['products_date_added'])),