Public Member Functions | |
getLayer () | |
getStateHtml () | |
getFilters () | |
canShowOptions () | |
canShowBlock () | |
Protected Member Functions | |
_prepareLayout () | |
_getFilterableAttributes () | |
_getCategoryFilter () | |
_getPriceFilter () |
Definition at line 34 of file View.php.
_getCategoryFilter | ( | ) | [protected] |
_getFilterableAttributes | ( | ) | [protected] |
Get all fiterable attributes of current category
Definition at line 86 of file View.php.
00087 { 00088 $attributes = $this->getData('_filterable_attributes'); 00089 if (is_null($attributes)) { 00090 $attributes = $this->getLayer()->getFilterableAttributes(); 00091 $this->setData('_filterable_attributes', $attributes); 00092 } 00093 return $attributes; 00094 }
_getPriceFilter | ( | ) | [protected] |
_prepareLayout | ( | ) | [protected] |
Prepare child blocks
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 41 of file View.php.
00042 { 00043 $stateBlock = $this->getLayout()->createBlock('catalog/layer_state') 00044 ->setLayer($this->getLayer()); 00045 00046 $categryBlock = $this->getLayout()->createBlock('catalog/layer_filter_category') 00047 ->setLayer($this->getLayer()) 00048 ->init(); 00049 00050 $this->setChild('layer_state', $stateBlock); 00051 $this->setChild('category_filter', $categryBlock); 00052 00053 $filterableAttributes = $this->_getFilterableAttributes(); 00054 foreach ($filterableAttributes as $attribute) { 00055 $filterBlockName = 'catalog/layer_filter_attribute'; 00056 if ($attribute->getFrontendInput() == 'price') { 00057 $filterBlockName = 'catalog/layer_filter_price'; 00058 } 00059 00060 $this->setChild($attribute->getAttributeCode().'_filter', 00061 $this->getLayout()->createBlock($filterBlockName) 00062 ->setLayer($this->getLayer()) 00063 ->setAttributeModel($attribute) 00064 ->init()); 00065 } 00066 00067 $this->getLayer()->apply(); 00068 return parent::_prepareLayout(); 00069 }
canShowBlock | ( | ) |
Check availability display layer block
Reimplemented in Mage_CatalogSearch_Block_Layer.
Definition at line 156 of file View.php.
00157 { 00158 return $this->canShowOptions() || count($this->getLayer()->getState()->getFilters()); 00159 }
canShowOptions | ( | ) |
Check availability display layer options
Definition at line 141 of file View.php.
00142 { 00143 foreach ($this->getFilters() as $filter) { 00144 if ($filter->getItemsCount()) { 00145 return true; 00146 } 00147 } 00148 return false; 00149 }
getFilters | ( | ) |
Get all layer filters
Definition at line 111 of file View.php.
00112 { 00113 $filters = array(); 00114 if ($categoryFilter = $this->_getCategoryFilter()) { 00115 $filters[] = $categoryFilter; 00116 } 00117 00118 $filterableAttributes = $this->_getFilterableAttributes(); 00119 foreach ($filterableAttributes as $attribute) { 00120 $filters[] = $this->getChild($attribute->getAttributeCode().'_filter'); 00121 } 00122 00123 return $filters; 00124 }
getLayer | ( | ) |
Get layer object
Reimplemented in Mage_CatalogSearch_Block_Layer.
Definition at line 76 of file View.php.
00077 { 00078 return Mage::getSingleton('catalog/layer'); 00079 }
getStateHtml | ( | ) |
Get layered navigation state html
Definition at line 101 of file View.php.
00102 { 00103 return $this->getChildHtml('layer_state'); 00104 }