I wanted to create a block that would display products from 2 (or more) categories. I've tried to do that in several ways but they don't work.
How I tried:
/app/code/local/Mage/Catalog/Block/Product/Fulllist.php (same as List.php with changed _getProductCollection() function:)
protected function _getProductCollection()
{
$_productCollection = Mage::getModel('catalog/product')
->getCollection()
->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
->addAttributeToSelect('*')
->addAttributeToFilter('category_id', array(
array('finset' => '30'),
array('finset' => '32'))
)
->addAttributeToSort('created_at', 'desc');
return $_productCollection;
}
Then, at one of CMS pages i tried to use:
{{block type="catalog/product_fulllist" template="catalog/product/list.phtml"}}
But that doesn't seem to work, page is clear. Am I missing any part? Or is there an easier way to do that?
Greetings!