Example #1
0
 /**
  * Product collection initialize process
  *
  * @return \Magento\Catalog\Model\ResourceModel\Product\Collection|Object|\Magento\Framework\Data\Collection
  */
 protected function _getProductCollection()
 {
     switch ($this->getDisplayType()) {
         case self::DISPLAY_TYPE_NEW_PRODUCTS:
             $collection = parent::_getProductCollection()->setPageSize($this->getPageSize())->setCurPage($this->getCurrentPage());
             break;
         default:
             $collection = $this->_getRecentlyAddedProductsCollection();
             break;
     }
     return $collection;
 }