我正在嘗試在主頁上顯示最受歡迎的產品。獲得跟隨錯誤。找不到類'Mage_Catalog_Block_Product_Mostviewed'[magento]
class Mage_Catalog_Block_Product_Mostviewed extends Mage_Catalog_Block_Product_Abstract {
public
function __construct() {
parent::__construct();
$storeId = Mage::app() - > getStore() - > getId();
$products = Mage::getResourceModel('reports/product_collection') - > addOrderedQty() - > addAttributeToSelect('*') - > addAttributeToSelect(array('name', 'price', 'small_image')) - > setStoreId($storeId) - > addStoreFilter($storeId) - > addViewsCount();
Mage::getSingleton('catalog/product_status') - > addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility') - > addVisibleInCatalogFilterToCollection($products);
$products - > setPageSize(5) - > setCurPage(1);
$this - > setProductCollection($products);
}
}
Fatal error: Class 'Mage_Catalog_Block_Product_Mostviewed' not found in C:\xampp\htdocs\ifasonx\app\code\core\Mage\Core\Model\Layout.php on line 491
REFFERENCE: - http://www.magikcommerce.com/blog/how-to-show-most-viewed-best-selling-products-in-magento-store/