Magento Debugging Tips

Some helpful snippets of code to use when debugging magento:

  var_export(get_class_methods(get_class($classname)));
  var_export(array_keys( $this->getData() )); //or
  var_export(array_keys( $object->getData() ));
  var_export($object->debug());

When using with Mage::log()...

  Mage::log(var_export(get_class_methods(get_class($classname)), TRUE),NULL,'some_filename.log');
  Mage::log(var_export(array_keys( $this->getData() ), TRUE),NULL,'some_filename.log'); //or
  Mage::log(var_export(array_keys( $object->getData() ), TRUE),NULL,'some_filename.log');
  Mage::log(var_export($object->debug(), TRUE));



 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs