2012-09-05 65 views
0

我需要删除默认的Magento结账并添加自定义one.Problem是自定义扩展模板不loading.Log不显示任何errors.I附上截图http://skit.ch/nwpiMagento的模板不加载

代码是在这里https://gist.github.com/3636029

这里有两个问题,

块是不是呈现?

尽管我没有设置"checkout.onepage"块,但当我转储整个布局时,它会显示默认的结帐布局代码。这种正常行为?

+0

愚蠢的问题:你的模块是否启用? – Kalpesh

+0

布局文件onepagecheckout.xml的放置位置?你能显示文件路径吗? – ceckoslab

+0

@ceckoslab我已经更新了代码。 – blakcaps

回答

2

问题就出在你的控制器:

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

参见:

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; 
} 

所以,你的代码应该是,无论是:

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

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