Public Member Functions | |
getProductCollection () | |
prepareProductCollection ($collection) | |
getStateKey () | |
getStateTags (array $additionalTags=array()) | |
Public Attributes | |
const | XML_PATH_DISPLAY_LAYER_COUNT = 'catalog/search/use_layered_navigation_count' |
Protected Member Functions | |
_prepareAttributeCollection ($collection) | |
_prepareAttribute ($attribute) |
Definition at line 27 of file Layer.php.
_prepareAttribute | ( | $ | attribute | ) | [protected] |
Prepare attribute for use in layered navigation
Mage_Eav_Model_Entity_Attribute | $attribute |
Reimplemented from Mage_Catalog_Model_Layer.
Definition at line 117 of file Layer.php.
00118 { 00119 $attribute = parent::_prepareAttribute($attribute); 00120 $attribute->setIsFilterable(Mage_Catalog_Model_Layer_Filter_Attribute::OPTIONS_ONLY_WITH_RESULTS); 00121 return $attribute; 00122 }
_prepareAttributeCollection | ( | $ | collection | ) | [protected] |
Add filters to attribute collection
Mage_Eav_Model_Mysql4_Entity_Attribute_Collection | $collection |
Reimplemented from Mage_Catalog_Model_Layer.
Definition at line 105 of file Layer.php.
getProductCollection | ( | ) |
Get current layer product collection
Reimplemented from Mage_Catalog_Model_Layer.
Definition at line 36 of file Layer.php.
00037 { 00038 if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) { 00039 $collection = $this->_productCollections[$this->getCurrentCategory()->getId()]; 00040 } 00041 else { 00042 $collection = Mage::getResourceModel('catalogsearch/fulltext_collection'); 00043 $this->prepareProductCollection($collection); 00044 $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection; 00045 } 00046 00047 return $collection; 00048 }
getStateKey | ( | ) |
Get layer state key
Reimplemented from Mage_Catalog_Model_Layer.
Definition at line 77 of file Layer.php.
00078 { 00079 if ($this->_stateKey === null) { 00080 $this->_stateKey = 'Q_'.Mage::helper('catalogSearch')->getQuery()->getId() 00081 .'_'.parent::getStateKey(); 00082 } 00083 return $this->_stateKey; 00084 }
Get default tags for current layer state
array | $additionalTags |
Reimplemented from Mage_Catalog_Model_Layer.
Definition at line 92 of file Layer.php.
00093 { 00094 $additionalTags = parent::getStateTags($additionalTags); 00095 $additionalTags[] = Mage_CatalogSearch_Model_Query::CACHE_TAG; 00096 return $additionalTags; 00097 }
prepareProductCollection | ( | $ | collection | ) |
Prepare product collection
Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection | $collection |
Reimplemented from Mage_Catalog_Model_Layer.
Definition at line 56 of file Layer.php.
00057 { 00058 $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes()) 00059 ->addSearchFilter(Mage::helper('catalogSearch')->getEscapedQueryText()) 00060 ->setStore(Mage::app()->getStore()) 00061 ->addMinimalPrice() 00062 ->addFinalPrice() 00063 ->addTaxPercents() 00064 ->addStoreFilter() 00065 ->addUrlRewrite(); 00066 00067 Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection); 00068 Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection); 00069 return $this; 00070 }
const XML_PATH_DISPLAY_LAYER_COUNT = 'catalog/search/use_layered_navigation_count' |