protected function setDataRecentIndexProduct()
    {
        $products = $this->getRecentProduct();

        if (!empty($products)) {

            $pager_options = array(
                'key' => 'pwp',
                'total' => count($products),
                'limit' => $this->config('product_view_pager_limit', 4)
            );

            $pager = $this->getPager($pager_options);

            if (!empty($pager['limit'])) {
                list($from, $to) = $pager['limit'];
                $products = array_slice($products, $from, $to, true);
            }

            $data = array('pager' => $pager['rendered'], 'products' => $products);
            $this->setData('recent', $this->render('product/recent', $data));
        }
    }
protected function setDataRecentIndexProduct()
    {
        $products = $this->getRecentProduct();

        if (!empty($products)) {

            $pager_options = array(
                'key' => 'pwp',
                'total' => count($products),
                'limit' => $this->config('product_view_pager_limit', 4)
            );

            $pager = $this->getPager($pager_options);

            if (!empty($pager['limit'])) {
                list($from, $to) = $pager['limit'];
                $products = array_slice($products, $from, $to, true);
            }

            $data = array('pager' => $pager['rendered'], 'products' => $products);
            $this->setData('recent', $this->render('product/recent', $data));
        }
    }
protected function setDataRecentIndexProduct ( ) { $ products = $ this -> getRecentProduct ( ) ; if ( ! empty ( $ products ) ) { $ pager_options = array ( 'key' => 'pwp' , 'total' => count ( $ products ) , 'limit' => $ this -> config ( 'product_view_pager_limit' , 4 ) ) ; $ pager = $ this -> getPager ( $ pager_options ) ; if ( ! empty ( $ pager [ 'limit' ] ) ) { list ( $ from , $ to ) = $ pager [ 'limit' ] ; $ products = array_slice ( $ products , $ from , $ to , true ) ; } $ data = array ( 'pager' => $ pager [ 'rendered' ] , 'products' => $ products ) ; $ this -> setData ( 'recent' , $ this -> render ( 'product/recent' , $ data ) ) ; } }
Sets the recent products block
Sets the recent products block