0
votes

I have a custom made menu, that contains products from specific category (category id=3). In my menu there is a block:

{{block type="catalog/product_list" name="product_list" mode="grid" template="catalog/product/category_list_1.phtml"}}

I can normally see the products on main site and inside the category, but on product page the getBlockTemplateProcessor() doesn't return any data.

The code inside file is the same as for list.phtml, i just made some html modifications, located in: \catalog\product\list.phtml

Why exactly is my code not rendering? Is it a problem that the files can't be located from product site? Why all is good inside a category site and on product site not?

1

1 Answers

0
votes

I suggest you use your own block extending the product list block, so that you can properly set the product collection, something like:

class YourNamespace_YourModule_Block_List extends Mage_Catalog_Block_Product_List
{
    protected function _getProductCollection()
    {
        if (is_null($this->_productCollection)) {
            $collection = Mage::getResourceModel('catalog/product_collection');
            Mage::getModel('catalog/layer')->prepareProductCollection($collection);

            $prodIdArray = array(1,2,3,4,5);

            $collection->addAttributeToFilter('entity_id', $prodIdArray);
            $collection->addStoreFilter();
            $this->_productCollection = $collection;
        }
        return $this->_productCollection;
    }
}

You can filter to add or remove any products that you want from the listing.