diff --git a/adm/ajax.php b/adm/ajax.php index 609f75d7..e8dc5d9f 100755 --- a/adm/ajax.php +++ b/adm/ajax.php @@ -127,7 +127,7 @@ if (isset($_GET['ajaxDiscountCustomers'])) $filter = Tools::getValue('filter'); $filterWithIdCustomer = false; - if (strpos($filter, '_')) { + if (strpos($filter, '0_') === 0) { $filterArray = explode('_', $filter); $filter = $filterArray[1]; $filterWithIdCustomer = true; diff --git a/adm/tabs/AdminDiscounts.php b/adm/tabs/AdminDiscounts.php index d471536b..4eaaa36f 100755 --- a/adm/tabs/AdminDiscounts.php +++ b/adm/tabs/AdminDiscounts.php @@ -381,10 +381,11 @@ class AdminDiscounts extends AdminTab function fillCustomersAjax() { var filterValue = \''.(($value = (int)($this->getFieldValue($obj, 'id_customer'))) ? '0_'.$value : (($value = (int)($this->getFieldValue($obj, 'id_group'))) ? '1_'.$value : '')).'\'; - if ($(\'#filter\').val()) + if ($(\'#filter\').val()) { filterValue = $(\'#filter\').val(); + } $.ajaxSetup({ cache: false }); - $.getJSON("'.dirname($currentIndex).'/ajax.php",{ajaxDiscountCustomers:1,filter:filterValue}, + $.getJSON("'.dirname($currentIndex).'/ajax.php", {ajaxDiscountCustomers:1, filter:filterValue}, function(obj) { var groups_length = obj.groups.length; if (obj.groups.length == 0)