*/ class Mage_Rss_Block_Order_Status extends Mage_Core_Block_Template { protected function _construct() { /* * setting cache to save the rss for 10 minutes */ $this->setCacheKey('rss_order_status_'.$this->getRequest()->getParam('data')); $this->setCacheLifetime(600); } protected function _toHtml() { $rssObj = Mage::getModel('rss/rss'); $order = Mage::registry('current_order'); $title = Mage::helper('rss')->__('Order # %s Notification(s)',$order->getIncrementId()); $newurl = Mage::getUrl('sales/order/view',array('order_id' => $order->getId())); $data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8', ); $rssObj->_addHeader($data); $resourceModel = Mage::getResourceModel('rss/order'); $results = $resourceModel->getAllCommentCollection($order->getId()); if($results){ foreach($results as $result){ $urlAppend = 'view'; $type = $result['entity_type_code']; if($type && $type!='order'){ $urlAppend = $type; } $type = Mage::helper('rss')->__(ucwords($type)); $title = Mage::helper('rss')->__('Details for %s #%s', $type, $result['increment_id']); $description = '
'.
Mage::helper('rss')->__('Notified Date: %s
',$this->formatDate($result['created_at'])).
Mage::helper('rss')->__('Comment: %s
',$result['comment']).
'
'.
Mage::helper('rss')->__('Current Status: %s
',$order->getStatusLabel()).
Mage::helper('rss')->__('Total: %s
',$order->formatPrice($order->getGrandTotal())).
'