blakcaps
blakcaps

Reputation: 2647

Magento Template is not Loading

I need to remove default Magento checkout and add custom one.Problem is Custom extension template is not loading.Log doesn't show any errors.I have attached screenshot http://skit.ch/nwpi

Code is here https://gist.github.com/3636029

Two questions here,

Blocks are not rendering?

Even though I've unset "checkout.onepage" block,when I dump entire layout,it shows the default checkout layout code.Is this normal behavior?

Upvotes: 0

Views: 144

Answers (1)

ivantedja
ivantedja

Reputation: 2553

The problem lies in your controller:

$this->getLayout()->getBlock('content')->unsetChildren('checkout.onepage');

See:

Mage_Core_Block_Abstract

/**
 * Unset all children blocks
 *
 * @return Mage_Core_Block_Abstract
 */
public function unsetChildren()
{
    $this->_children       = array();
    $this->_sortedChildren = array();
    return $this;
}

/**
 * Unset child block
 *
 * @param  string $alias
 * @return Mage_Core_Block_Abstract
 */
public function unsetChild($alias)
{
    if (isset($this->_children[$alias])) {
        unset($this->_children[$alias]);
    }

    if (!empty($this->_sortedChildren)) {
        $key = array_search($alias, $this->_sortedChildren);
        if ($key !== false) {
            unset($this->_sortedChildren[$key]);
        }
    }

    return $this;
}

So your code should be, either:

$this->getLayout()->getBlock('checkout.onepage')->unsetChildren();

OR

$this->getLayout()->getBlock('content')->unsetChild('checkout.onepage');

Upvotes: 2

Related Questions