我有一个模块
Shop_All.xml
<?xml version="1.0"?>
<config>
<modules>
<Shop_Productlists>
<active>true</active>
<codePool>local</codePool>
</Shop_Productlists>
</modules>
</config>
小部件.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>
建议.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;
}
}
但是该小部件未显示在 CMS->Widget-Instances->New Widget Instance 下的管理面板中
任何想法为什么?我已经删除了缓存目录并重新登录到管理面板
“productlists”模块的其他块等正在工作