Magento - 无效的块类型

时间:2014-03-07 14:18:34

标签: php magento

每当我使用Buckaroo的付款担保方式下订单时,我都会收到一条消息:您的付款未成功。请重试或选择其他付款方式。

然后将以下堆栈跟踪代码添加到exception.log文件中:

   2014-03-07T14:10:26+00:00 ERR (3): 
    exception 'Mage_Core_Exception' with message 'Invalid blocktype: ' in /app/Mage.php:594
    Stack trace:
    #0 /app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid blockty...')
    #1 /app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array)
    #2 /app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', 'cart_sidebar')
    #3 /app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', 'cart_sidebar')
    #4 /app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
    #5 /app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
    #6 /app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
    #7 /app/code/core/Mage/Catalog/controllers/CategoryController.php(146): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
    #8 /app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Catalog_CategoryController->viewAction()
    #9 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
    #10 /app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
    #11 /app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
    #12 /app/Mage.php(683): Mage_Core_Model_App->run(Array)
    #13 /index.php(87): Mage::run('', 'store')
    #14 {main}

它表示无效的blocktype:并且似乎没有显示名称。

不要以为它与在支付方式的form.phtml中创建块的代码有什么关系?

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('buckaroo3extended/paymentguarantee/termsAndConditions.phtml')->toHtml();?>

1 个答案:

答案 0 :(得分:4)

很可能在您的布局文件中声明了一个没有类型的块 像这样:

<block name="cart_sidebar" ...>...</block>

它应该是

<block type="checkout/cart_sidebar" name="cart_sidebar">...</block>

或者它应该是

<reference name="cart_sidebar">...</reference>

我的钱在第二个。请查看cart_sidebar的布局文件。