We use cookies to improve our services and provide a better experience. By continuing to use this site, you agree with our Cookies Policy.

Tutorials
More than 400 step-by-step articles to guide you through online project development.
HomeTutorialsCMS TutorialsMagentoMagento Administration

How to set the pubdate for new products feed

Germany Cloud Servers
OpenVZ VPS
Ubuntu VPS
Windows Cloud Server
KVM VPS
Linux Cloud Server
Brazil VPS
cPanel KVM
USA VPS
Linux KVM Hosting

If you want to adjust the feed of new products so that the RSS feed pubDate would be set to “news_from_date” the same as the current time.

To accomplish this, you will need to customize a code in your Magento installation. You will need to use an FTP client or a file manager.

Here you can see the code which you will need to use.

1
2
3
4
5
6
 $data = array(
'title'         => $product->getName(),
'link'          => $url,
'description'   => $description,
'lastUpdate'        => strtotime($product->getUpdatedAt()),
);

Note that if you’re using newer versions of Magento, you should use “lastUpdate” instead of “pubDate”. The provided code entry should be used in the “addNotifyItemXmlCallback” function in order to adjust the pubDate for the new products feed.

Ubuntu VPS
Linux Cloud Server
OpenVZ VPS
Windows Cloud Server
Germany Cloud Servers
KVM VPS
USA VPS
Brazil VPS
cPanel KVM
Linux KVM Hosting
Rate this Tutorial:
No Comments Leave a Comment
Leave a Comment