quick magento tips

// get user ip
Mage::helper('core/http')->getRemoteAddr(true));

// get user session id
Mage::getModel("core/session")->getEncryptedSessionId());

// update database config on the fly
Mage::getModel('core/config')->saveConfig('payment/worldpaydirect/merchant_id', '1111111'); 
Mage::getConfig()->reinit();
Mage::app()->reinitStores();

Author: bpeh

Bernard Peh is a great passioner of web technologies and one of the co-founder of Sitecritic.net Website Design and Reviews. He works with experienced web designers and developers everyday, developing and designing commercial websites. He specialises mainly in SEO and PHP programming.