[-] FO : #PSFV-553 - Fix bugs with pager and ordering with some controllers
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13642 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+13
-5
@@ -416,14 +416,22 @@ class LinkCore
|
||||
|
||||
public function getPaginationLink($type, $id_object, $nb = false, $sort = false, $pagination = false, $array = false)
|
||||
{
|
||||
// If no parameter $type, try to get it by using the controller name
|
||||
if (!$type && !$id_object)
|
||||
{
|
||||
$method_name = 'get'.Dispatcher::getInstance()->getController().'Link';
|
||||
if (method_exists($this, $method_name) && isset($_GET['id_'.Dispatcher::getInstance()->getController()]))
|
||||
{
|
||||
$type = Dispatcher::getInstance()->getController();
|
||||
$id_object = $_GET['id_'.Dispatcher::getInstance()->getController()];
|
||||
}
|
||||
}
|
||||
|
||||
if ($type && $id_object)
|
||||
$url = $this->{'get'.$type.'Link'}($id_object, null);
|
||||
else
|
||||
{
|
||||
$url = $this->url;
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
$url = $this->getPageLink(basename($url));
|
||||
}
|
||||
$url = $this->getPageLink(Context::getContext()->controller->php_self);
|
||||
|
||||
$vars = (!$array) ? '' : array();
|
||||
$vars_nb = array('n', 'search_query');
|
||||
$vars_sort = array('orderby', 'orderway');
|
||||
|
||||
@@ -320,7 +320,8 @@ class FrontControllerCore extends Controller
|
||||
'vat_management' => (int)Configuration::get('VATNUMBER_MANAGEMENT'),
|
||||
'opc' => (bool)Configuration::get('PS_ORDER_PROCESS_TYPE'),
|
||||
'PS_CATALOG_MODE' => (bool)Configuration::get('PS_CATALOG_MODE') || !(bool)Group::getCurrent()->show_prices,
|
||||
'b2b_enable' => (bool)Configuration::get('PS_B2B_ENABLE')
|
||||
'b2b_enable' => (bool)Configuration::get('PS_B2B_ENABLE'),
|
||||
'request' => $link->getPaginationLink(false, false, false, true)
|
||||
));
|
||||
|
||||
// Deprecated
|
||||
|
||||
@@ -25,15 +25,19 @@
|
||||
*}
|
||||
|
||||
{if isset($orderby) AND isset($orderway)}
|
||||
<!-- Sort products -->
|
||||
{if isset($smarty.get.id_category) && $smarty.get.id_category}
|
||||
{assign var='request' value=$link->getPaginationLink('category', $category, false, true)}
|
||||
{elseif isset($smarty.get.id_manufacturer) && $smarty.get.id_manufacturer}
|
||||
{assign var='request' value=$link->getPaginationLink('manufacturer', $manufacturer, false, true)}
|
||||
{elseif isset($smarty.get.id_supplier) && $smarty.get.id_supplier}
|
||||
{assign var='request' value=$link->getPaginationLink('supplier', $supplier, false, true)}
|
||||
{else}
|
||||
{assign var='request' value=$link->getPaginationLink(false, false, false, true)}
|
||||
|
||||
{* On 1.5 the var request is setted on the front controller. The next lines assure the retrocompatibility with some modules *}
|
||||
{if !isset($request)}
|
||||
<!-- Sort products -->
|
||||
{if isset($smarty.get.id_category) && $smarty.get.id_category}
|
||||
{assign var='request' value=$link->getPaginationLink('category', $category, false, true)}
|
||||
{elseif isset($smarty.get.id_manufacturer) && $smarty.get.id_manufacturer}
|
||||
{assign var='request' value=$link->getPaginationLink('manufacturer', $manufacturer, false, true)}
|
||||
{elseif isset($smarty.get.id_supplier) && $smarty.get.id_supplier}
|
||||
{assign var='request' value=$link->getPaginationLink('supplier', $supplier, false, true)}
|
||||
{else}
|
||||
{assign var='request' value=$link->getPaginationLink(false, false, false, true)}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -44,7 +48,7 @@ $(document).ready(function()
|
||||
{
|
||||
var requestSortProducts = '{$request}';
|
||||
var splitData = $(this).val().split(':');
|
||||
document.location.href = requestSortProducts + ((requestSortProducts.indexOf('?') < 0) ? '?' : '&') + 'orderby=' + splitData[0] + '&orderway=' + splitData[1];
|
||||
document.location.href = requestSortProducts + ((requestSortProducts.indexOf('?') < 0) ? '?' : '&') + 'orderby=' + splitData[0] + '&orderway=' + splitData[1];
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
|
||||
Reference in New Issue
Block a user