Skip to content

Commit

Permalink
Storefront: category page pagination fix #151
Browse files Browse the repository at this point in the history
  • Loading branch information
abolabo committed Jun 9, 2015
1 parent 476fd24 commit bd1f14b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions public_html/storefront/controller/pages/product/category.php
Expand Up @@ -101,21 +101,20 @@ public function main() {
}

if (isset($this->request->get['sort'])) {
list($sort,$order) = explode("-",$this->request->get['sort']);
$sorting_href = $this->request->get['sort'];
list($sort,$order) = explode("-",$sorting_href);
} else {
list($sort,$order) = explode("-",$this->config->get('config_product_default_sort_order'));
$sorting_href = $this->config->get('config_product_default_sort_order');
list($sort,$order) = explode("-",$sorting_href);
if($sort=='name'){
$sort = 'pd.'.$sort;
}elseif(in_array($sort,array('sort_order','price'))){
$sort = 'p.'.$sort;
}
}

$url = '';

if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}
$url = '&sort=' . $sorting_href;


if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
Expand Down Expand Up @@ -318,7 +317,7 @@ public function main() {
$this->view->assign( 'sorting', $sorting );
$this->view->assign( 'url', $this->html->getSEOURL('product/category','&path=' . $this->request->get['path']));

$pegination_url = $this->html->getSEOURL('product/category','&path=' . $this->request->get['path'] . '&sort=' . $this->request->get['sort'] . '&page={page}' . '&limit=' . $limit, '&encode');
$pegination_url = $this->html->getSEOURL('product/category','&path=' . $this->request->get['path'] . '&sort=' . $sorting_href . '&page={page}' . '&limit=' . $limit, '&encode');

$this->view->assign('pagination_bootstrap', HtmlElementFactory::create( array (
'type' => 'Pagination',
Expand Down

0 comments on commit bd1f14b

Please sign in to comment.