Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <config>
- <modules>
- <Bileamara_SpecialCollection>
- <version>0.0.1</version>
- </Bileamara_SpecialCollection>
- </modules>
- <global>
- <blocks>
- <specialcollection>
- <class>Bileamara_SpecialCollection_Block</class>
- </specialcollection>
- </blocks>
- <models>
- <specialcollection>
- <class>Bileamara_SpecialCollection_Model</class>
- </specialcollection>
- </models>
- </global>
- </config>
- <?php
- class Bileamara_SpecialCollection_Block_Magazzino extends Mage_Catalog_Block_Product_List
- {
- public function getLayer()
- {
- $layer = Mage::registry('current_layer');
- if ($layer) {
- return $layer;
- }
- return Mage::getSingleton('specialcollection/magazzino');
- }
- }
- <?php
- class Bileamara_SpecialCollection_Model_Magazzino extends Mage_Catalog_Model_Layer
- {
- public function prepareProductCollection($collection)
- {
- $collection
- ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
- ->addAttributeToFilter('real_stock','1')
- ->addMinimalPrice()
- ->addFinalPrice()
- ->addTaxPercents()
- ->addUrlRewrite($this->getCurrentCategory()->getId());
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
- Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
- return $this;
- }
- }
Add Comment
Please, Sign In to add comment