How to get access of magento core functions from outside the magento directory

piaoling  2011-07-14 18:34:42

This is the very important thing in magento while accessing data from outside of the magento, You also can use it to set cron job of any magento function, as cron job doen't work properly in magento.


require_once 'app/Mage.php'; // if your are not root folder then write the proper path like publichtml/magento/app/Mage.php
Mage::app('default');


Now you can create object of any classes and can access methods of those classes also.
Like the Below example

$obj = new Mage_Checkout_Model_Observer();
echo $obj->salesQuoteSaveAfter();

类别 :  magento(258)  |  浏览(3107)  |  评论(0)
发表评论(评论将通过邮件发给作者):

Email: