0); if ($feed_id = $this->getRequest()->getParam('id')) { $feed = Mage::getModel('gomage_feed/item')->load($feed_id); $start = intval($this->getRequest()->getParam('start')); $length = intval($this->getRequest()->getParam('length')); if ($start >= 0 && $length >= 0) { if ($feed->getType() == 'csv') { $feed->writeTempFile($start, $length); } else { Mage::getModel('gomage_feed/item_block_product', array('feed' => $feed, 'content' => ''))->writeTempFile($start, $length); } $response['result'] = 1; } } $this->getResponse()->setBody(Zend_Json::encode($response)); } public function generateAction() { $feed = Mage::getModel('gomage_feed/item')->load($this->getRequest()->getParam('feed_id')); @ignore_user_abort(true); $this->getResponse() ->setHttpResponseCode(200) ->setHeader('Connection', 'close', true) ->setHeader('Content-Length', '0', true); $this->getResponse()->clearBody(); $this->getResponse()->sendResponse(); $generate_info = Mage::helper('gomage_feed/generator')->getGenerateInfo($feed->getId()); if (!$generate_info->inProcess()){ $feed->generate(); } } }