public function _toHtml() { $html = parent::_toHtml(); $fileIds = array(); $order = $this->getOrder(); foreach ($order->getAllItems() as $item) { $ids = Mage::getResourceSingleton('downloads/relation')->getFileIds($item->getProductId()); $fileIds = array_merge($fileIds, $ids); } $fileIds = array_unique($fileIds); $files = Mage::getResourceModel('downloads/files_collection'); $files->addResetFilter()->addFilesFilter($fileIds)->addStatusFilter()->addCategoryStatusFilter()->addStoreFilter()->addSortOrder(); if (!$files->count()) { return $html; } $filesBlock = $this->getLayout()->createBlock('downloads/link', 'downloads', array('ids' => $fileIds, 'is_email' => 1)); $html .= $filesBlock->toHtml(); return $html; }
protected function _toHtml() { $this->setTemplate('aw_points/email/order/invoice/items.phtml'); return parent::_toHtml(); }