This commit is contained in:
Michael RICOIS 2018-03-08 17:24:53 +01:00
parent 87387701c3
commit 9e386209d7
2 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -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)