Вопрос

My block is not calling in shell script.

<?php
ini_set('display_errors', 1); 
require_once 'abstract.php';
class Mage_Shell_ReportMail extends Mage_Shell_Abstract{
    public function run(){
        Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
        echo Mage::app()->getLayout()->createBlock('adminhtml/template')->setTemplate('salesreport.phtml')->toHtml();
    }
}

$shell = new Mage_Shell_ReportMail();
$shell->run();

?>
Это было полезно?

Решение

It seems block was not taking correct template area and it was trying to find file in frontend area instead adminhtml.

Need to define template area for adminhtml so it will call from correct path.

 Mage::getDesign()->setArea('adminhtml');
Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top