public function setCollection($collection) { parent::setCollection($collection); if ($this->getCurrentOrder()) { $this->_collection->getSelect()->order("{$this->getCurrentOrder()} {$this->getCurrentDirection()}"); } return $this; }
public function setCollection($collection) { parent::setCollection($collection); if ($this->getCurrentOrder() && $this->getCurrentDirection()) { $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection()); } return $this; }
public function setCollection($collection) { if (!Mage::helper('searchanise/ApiSe')->checkSearchaniseResult(true)) { return parent::setCollection($collection); } if (!method_exists($collection, 'checkSearchaniseResult') || !$collection->checkSearchaniseResult()) { return parent::setCollection($collection); } $this->_collection = $collection; $this->_collection->setCurPage($this->getCurrentPage()); // we need to set pagination only if passed value integer and more that 0 $limit = (int) $this->getLimit(); if ($limit) { //~ $this->_collection->setPageSize($limit); } if ($this->getCurrentOrder()) { $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection()); } return $this; }