Skip to content

Commit 5408e85

Browse files
authored
Merge pull request #192 from shreesh-webkul/gli-490
Fix page redirect issue after using the filter in Groups >> Customer render list (AdminGroupsController)
2 parents 27c91c3 + 9dcbc64 commit 5408e85

File tree

1 file changed

+44
-43
lines changed

1 file changed

+44
-43
lines changed

Diff for: controllers/admin/AdminGroupsController.php

+44-43
Original file line numberDiff line numberDiff line change
@@ -53,40 +53,6 @@ public function __construct()
5353
Configuration::get('PS_CUSTOMER_GROUP')
5454
);
5555

56-
$this->fields_list = array(
57-
'id_group' => array(
58-
'title' => $this->l('ID'),
59-
'align' => 'center',
60-
'class' => 'fixed-width-xs'
61-
),
62-
'name' => array(
63-
'title' => $this->l('Group name'),
64-
'filter_key' => 'b!name'
65-
),
66-
'reduction' => array(
67-
'title' => $this->l('Discount (%)'),
68-
'align' => 'right',
69-
'type' => 'percent'
70-
),
71-
'nb' => array(
72-
'title' => $this->l('Members'),
73-
'align' => 'center',
74-
'havingFilter' => true,
75-
),
76-
'show_prices' => array(
77-
'title' => $this->l('Show prices'),
78-
'align' => 'center',
79-
'type' => 'bool',
80-
'callback' => 'printShowPricesIcon',
81-
'orderby' => false
82-
),
83-
'date_add' => array(
84-
'title' => $this->l('Creation date'),
85-
'type' => 'date',
86-
'align' => 'right'
87-
)
88-
);
89-
9056
$this->addRowActionSkipList('delete', $groups_to_keep);
9157

9258
parent::__construct();
@@ -179,17 +145,15 @@ public function initProcess()
179145
$this->action = 'change_show_prices_val';
180146
}
181147

182-
if (Tools::getIsset('viewgroup')) {
183-
$this->list_id = 'customer_group';
148+
parent::initProcess();
149+
}
184150

185-
if (isset($_POST['submitReset'.$this->list_id])) {
186-
$this->processResetFilters();
187-
}
188-
} else {
189-
$this->list_id = 'group';
151+
public function postProcess()
152+
{
153+
if (isset($_POST['submitResetcustomer_group'])) {
154+
$this->processResetFilters('customer_group');
190155
}
191-
192-
parent::initProcess();
156+
return parent::postProcess();
193157
}
194158

195159
public function renderView()
@@ -598,6 +562,43 @@ public function renderList()
598562
$this->displayInformation($unidentified_group_information);
599563
$this->displayInformation($guest_group_information);
600564
$this->displayInformation($default_group_information);
565+
566+
$this->fields_list = array(
567+
'id_group' => array(
568+
'title' => $this->l('ID'),
569+
'align' => 'center',
570+
'class' => 'fixed-width-xs'
571+
),
572+
'name' => array(
573+
'title' => $this->l('Group name'),
574+
'filter_key' => 'b!name'
575+
),
576+
'reduction' => array(
577+
'title' => $this->l('Discount (%)'),
578+
'align' => 'right',
579+
'type' => 'percent'
580+
),
581+
'nb' => array(
582+
'title' => $this->l('Members'),
583+
'align' => 'center',
584+
'havingFilter' => true,
585+
),
586+
'show_prices' => array(
587+
'title' => $this->l('Show prices'),
588+
'align' => 'center',
589+
'type' => 'bool',
590+
'callback' => 'printShowPricesIcon',
591+
'orderby' => false
592+
),
593+
'date_add' => array(
594+
'title' => $this->l('Creation date'),
595+
'type' => 'date',
596+
'align' => 'right'
597+
)
598+
);
599+
600+
$this->processFilter();
601+
601602
return parent::renderList();
602603
}
603604

0 commit comments

Comments
 (0)