Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
magento小部件不显示_Magento_Widget - Fatal编程技术网

magento小部件不显示

magento小部件不显示,magento,widget,Magento,Widget,我有一个模块 Shop_All.xml <?xml version="1.0"?> <config> <modules> <Shop_Productlists> <active>true</active> <codePool>local</codePool> </Shop_Productlists>

我有一个模块

Shop_All.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Shop_Productlists>
            <active>true</active>
            <codePool>local</codePool>
        </Shop_Productlists>
    </modules>
</config>

真的
地方的
widget.xml

<?xml version="1.0"?>
<widgets>
    <productlists_suggestion type="productlists/suggestion">
        <name>Suggestions</name>
        <description type="desc">Shows a product Grid</description>
    </productlists_suggestion>
</widgets> 

建议
显示产品网格
Suggestion.php

<?php
class Shop_Productlists_Block_Suggestion extends Mage_Core_Block_Abstract implements Mage_Widget_Block_Interface
{
    protected function _beforeToHtml()
    {
        $this->_prepareData();
        return parent::_beforeToHtml();
    }

    protected function _prepareData()
    {
        $collection = Mage::getModel("catalog/product")->getCollection();
        $collection->setPageSize(3);
        $this->getChild("suggestion_notoolbarlist")->setCollection($collection);
    }

    protected function _toHtml()
    {
        $html = '...';
        return $html;
    }   
}
确定找到了问题

在my widget.xml中,前面有一个空格

<?xml version="1.0"?>

所以它没有被解析。我认为解析器应该显示一个错误。但他没有