Guest User

Untitled

a guest
Dec 11th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <config>
  3. <modules>
  4. <Bileamara_SpecialCollection>
  5. <version>0.0.1</version>
  6. </Bileamara_SpecialCollection>
  7. </modules>
  8. <global>
  9. <blocks>
  10. <specialcollection>
  11. <class>Bileamara_SpecialCollection_Block</class>
  12. </specialcollection>
  13. </blocks>
  14. <models>
  15. <specialcollection>
  16. <class>Bileamara_SpecialCollection_Model</class>
  17. </specialcollection>
  18. </models>
  19. </global>
  20. </config>
  21.  
  22. <?php
  23. class Bileamara_SpecialCollection_Block_Magazzino extends Mage_Catalog_Block_Product_List
  24. {
  25. public function getLayer()
  26. {
  27. $layer = Mage::registry('current_layer');
  28. if ($layer) {
  29. return $layer;
  30. }
  31. return Mage::getSingleton('specialcollection/magazzino');
  32. }
  33. }
  34.  
  35. <?php
  36. class Bileamara_SpecialCollection_Model_Magazzino extends Mage_Catalog_Model_Layer
  37. {
  38. public function prepareProductCollection($collection)
  39. {
  40. $collection
  41. ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
  42. ->addAttributeToFilter('real_stock','1')
  43. ->addMinimalPrice()
  44. ->addFinalPrice()
  45. ->addTaxPercents()
  46. ->addUrlRewrite($this->getCurrentCategory()->getId());
  47.  
  48. Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
  49. Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
  50.  
  51. return $this;
  52. }
  53. }
Add Comment
Please, Sign In to add comment