I created this file (code\local\Mage\Catalog\Block\Product\Exclusives.php) to get all product from the attribute 'online_exclusive' that is also part for a specific attribute set id.

The code works, but in (template\catalog\product\exclusives.phtml) the toolbar is returning empty. If I remove ->addAttributeToFilter('attribute_set_id', $setID) the toolbar returns a true value. I can't think of any other way to work this out. How else could I look for the attribute_set_id. This is being used as a sub category page that is displaying a static block.

{{block type="catalog/product_exclusives" name="online.exclusives" alias="online.exclusives" column_count="6" products_count="400" template="catalog/product/exclusives.phtml"}}


class Mage_Catalog_Block_Product_Exclusives extends Mage_Catalog_Block_Product_List{

   protected function _getProductCollection($setID){    
      $collection = Mage::getResourceModel('catalog/product_collection');

      $collection = $this->_addProductAttributesAndPrices($collection)
         ->addAttributeToFilter('attribute_set_id', $setID)
         ->addAttributeToFilter('online_exclusive', true);


      return $collection;
   public function getLoadedProductOnlineExclusiveCollection($e){
     return $this->_getProductCollection($e);


  • can you post the code from your exclusives.phtml file.
    – Marius
    Commented Jul 27, 2015 at 15:47

1 Answer 1


I was able to fix this. I rewrote the function and extended _beforeToHtml()

protected function _getProductCollection()
        if (is_null($this->_productCollection)) {
            $layer = $this->getLayer();

            $origCategory = null;

                $this->_productCollection  = Mage::getModel('catalog/category')->load(Mage::registry('current_category')->getParentCategory()->getId())
                        ->addAttributeToFilter('online_exclusive', true)


            if ($origCategory) {

        return $this->_productCollection;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.