1

得到当前的store的RootCategoryId,---语句!!

$this->setCategoryId(Mage::app()->getStore()->getRootCategoryId());

2

得到catelog

$category = Mage::getModel('catalog/category')->load($this->getCategoryId());

3

  $collection = Mage::getResourceModel('catalog/product_collection')

            ->setStoreId($this->getStoreId())

            ->addCategoryFilter($this);

4

得到产品,以及过滤:


getResourceModel('catalog/product_collection')  ----->Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection