Magento 1.7 - getModel in script outside web application fails

后端 未结 7 1928
猫巷女王i
猫巷女王i 2021-01-17 04:31

    
        
            Starmall_Shipment_Model
            s         


        
7条回答
  •  独厮守ぢ
    2021-01-17 04:56

    Have a look how Magento cron works - it works as standalone script also (cron.php) and copy-paste code to your custom module. Main things:

     require 'app/Mage.php';
     ...
     Mage::getConfig()->init()
    

    Also it seems like modules not loaded Try to add after init config:

    Mage::getConfig()->loadModules();
    

提交回复
热议问题