Jump to content

Paginado en HelperList


ctorres90

Recommended Posts

Hola a todos, a alguien le a pasado en el Paginado de Prestashop con Helper List que al momento de presionar la pagina 2,3,n en el toolbar  te redireccione al index?.. ya intentamos muchas formas y siempre pasa lo mismo, alguien sabe como puedo modificar la accion que ejecuta el toolbar por default, para redireccionar de forma correcta?..

 

Dejo aqui parte de mi codigo:

 

    $ordenes = Db::getInstance()->executeS($sql);
    $resultado = count($ordenes);
    $this->helperList->listTotal = $resultado;
 
    $page_total = ceil($resultado/$this->helperList->_default_pagination);
    $page=Tools::getValue('submitFilterconfiguration');
    $this->helperList->currentIndex = AdminController::$currentIndex.'&configure='.$this->name.'&token='.$this->helperList->token.'&tab_module='.$this->tab.'&module_name='.$this->name.'&submitFilterconfiguration='.$page;
  
    $pagination=$this->helperList->_default_pagination;
    $ordenes = $this->paginate_content($ordenes, $page_total, $pagination, $page);
 
   
 
        return $processActionsOut.$this->helperList->generateList($ordenes, $fields_list).$this->renderForm();
 
    
Link to comment
Share on other sites

  • 1 year later...

HelperList doesn't manage pagination, it's the AdminController who is manage it.

HelperList is build to work inside an AdminController or a ModuleAdminController but you cannot use it in a Module class with all his functionality.

More about that : https://www.prestashop.com/forums/topic/985383-helperlist-filter-not-working/

Pagination is managed here in AdminController : https://github.com/PrestaShop/PrestaShop/blob/baa8c0be5cf2505d2cc1dbd28d5c801665675a04/classes/controller/AdminController.php#L3122

If you are in a Module, you can create a ModuleAdminController to access this functionalities 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...