/**
  * Retrieve collection last page number
  *
  * @return int
  */
 public function getLastPageNumber()
 {
     if (!$this->checkSearchaniseResult()) {
         return parent::getLastPageNumber();
     }
     $collectionSize = (int) $this->getSearchaniseRequest()->getTotalProduct();
     if (0 === $collectionSize) {
         return 1;
     } elseif ($this->_pageSize) {
         return ceil($collectionSize / $this->_pageSize);
     }
     return 1;
 }
Exemple #2
0
 /**
  * Set order
  *
  * @param string $attribute
  * @param string $dir
  * @return Mage_Reports_Model_Resource_Tag_Product_Collection
  */
 public function setOrder($attribute, $dir = self::SORT_ORDER_DESC)
 {
     if ($attribute == 'utaged' || $attribute == 'taged' || $attribute == 'tag_name') {
         $this->getSelect()->order($attribute . ' ' . $dir);
     } else {
         parent::setOrder($attribute, $dir);
     }
     return $this;
 }
Exemple #3
0
 /**
  * Retrieve collection last page number
  *
  * @return int
  */
 public function getLastPageNumberParent()
 {
     return parent::getLastPageNumber();
 }