php - Magento getSearchCriterias() method and its array composition -
i'm looking inside class mage_catalogsearch_block_advanced_result and, don't why, during $searchcriterias array composition, developers uses kind of strange script:
public function getsearchcriterias() { $searchcriterias = $this->getsearchmodel()->getsearchcriterias(); $middle = ceil(count($searchcriterias) / 2); $left = array_slice($searchcriterias, 0, $middle); $right = array_slice($searchcriterias, $middle); return array('left'=>$left, 'right'=>$right); }
why divide array $left , $right?
my guess usability reasons.
splitting search criterias allows display them 2-column block (the standard magento template catalogsearch/advanced/result.phtml
uses 2 <ul>
's this).
a 2-column block of search criterias takes lesser height 1-column block do, user see more results @ once below 2-column block, below 1-column block.
Comments
Post a Comment