Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jonatanrdsantos/e90f2e02b6cc00eec23d to your computer and use it in GitHub Desktop.
Save jonatanrdsantos/e90f2e02b6cc00eec23d to your computer and use it in GitHub Desktop.
Load custom block outside magento
<?php
include_once "app/Mage.php";
umask(0);
Mage::app()->loadArea('frontend');
$layout = Mage::getSingleton('core/layout');
//load default xml layout handle and generate blocks
$layout->getUpdate()->load('default');
$layout->generateXml()->generateBlocks();
//get the loaded head and header blocks and output
$headBlock = $layout->getBlock('head');
$headerBlock = $layout->getBlock('header');
$content = $layout->getBlock('content');
echo $headBlock->toHtml() . $headerBlock->toHtml();
echo $content->append( $layout->createBlock('braspag/payment_failure') )->toHtml();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment