2/18/2011

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

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();

No comments:

Post a Comment