Skip to content

Instantly share code, notes, and snippets.

@AndresInSpace
Last active May 29, 2018 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndresInSpace/fd47908c4876b1c0913fc1cdbeae165c to your computer and use it in GitHub Desktop.
Save AndresInSpace/fd47908c4876b1c0913fc1cdbeae165c to your computer and use it in GitHub Desktop.
Magento 1.x Cheatsheet
//Get Layout Handles Used
var_dump(Mage::app()->getLayout()->getUpdate()->getHandles());
//Get loaded layout blocks
var_dump(array_keys(Mage::app()->getLayout()->getAllBlocks()));
//Add to Global Messages
Mage::getSingleton('core/session')->addSuccess('Success Message');
Mage::getSingleton('core/session')->addError('Error Message');
Mage::getSingleton('core/session')->addWarning('Warning Message');
Mage::getSingleton('core/session')->addNotice('Notice Message');
can use
customer/session
catalog/session
//Dump callstack - useful for debugging
private function get_callstack() {
$dt = debug_backtrace();
$cs = array();
foreach ($dt as $t) {
$cs[] = $t['file'] . ' line ' . $t['line'] . ' calls ' . $t['function'] . "()" ;
}
return $cs;
}
Mage::log($this->get_callstack(),null,'callstack.log');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment