Aw: Pagination in list products
For those who experienced the same problem, I employed this code in listmodel.php, it is possible to use this code in a content plugin and trigger it wherever it is necessary:
In method load in the file above:
add this in the beginning of the method load:
$post = $app->input->get('jform', array(), 'post', array());
if(empty($post))
$limitstart = $this->getLimitStart();
else
$limitstart = $post['limitstart'];
then go to //$pagenav = $pagination->getPagesLinks();
comment it and instead:
$pagenav = $pagination->getPaginationPages();
$fields = "";
foreach($pagenav as $k=>$val){
if($k!=="all" && $k!=="pages"){
$value = substr($val['data']->link, strlen($val['data']->link)-3);
if(!intval($value))
{
$value = substr($val['data']->link, strlen($val['data']->link)-2);
if(!intval($value))
$value = substr($val['data']->link, strlen($val['data']->link)-1);
}
$fields .= "<button name='jform[limitstart]' value='".$value."' >".$k."</button>";}
}
$form = "<form action='index.php?option=com_jshopping&view=category&layout=category&task=view&category_id=".$catid."' method='post' id='adminForm' >".$fields."</form>";
comment this line: //$this->setPagenav($pagenav);
add this at the end of the method:
$this->setPagenav($form);
As I already mentioned, it had better to put this in a content plugin to trigger it wherever it is necessary.
Also there might be some conditions in the loop for the link attribute of paginationpages's object that I have not considered, this is only the base.
It works, yet I am possitive there are other ways.
Kian William Nowrouzian