@@ -170,6 +170,11 @@ public function __construct()
170
170
'type ' => 'datetime ' ,
171
171
'search ' => false ,
172
172
'havingFilter ' => true
173
+ ),
174
+ 'deleted ' => array (
175
+ 'title ' => $ this ->l ('Banned ' ),
176
+ 'type ' => 'bool ' ,
177
+ 'displayed ' => false ,
173
178
)
174
179
));
175
180
@@ -218,6 +223,12 @@ public function postProcess()
218
223
}
219
224
220
225
parent ::postProcess ();
226
+ // Added this to check if the filter for the banned(deleted) is used, since $this->delete = true will not display the deleted customers.
227
+ $ prefix = $ this ->getCookieFilterPrefix ();
228
+ $ filters = $ this ->context ->cookie ->getFamily ($ prefix .$ this ->table .'Filter_ ' );
229
+ if (isset ($ filters [$ prefix .$ this ->table .'Filter_deleted ' ]) && $ filters [$ prefix .$ this ->table .'Filter_deleted ' ] == 1 ) {
230
+ $ this ->deleted = false ;
231
+ }
221
232
}
222
233
223
234
public function initContent ()
@@ -753,6 +764,7 @@ public function renderKpis()
753
764
$ helper ->color = 'color2 ' ;
754
765
$ helper ->title = $ this ->l ('Banned Customers ' , null , null , false );
755
766
$ helper ->subtitle = $ this ->l ('All Time ' , null , null , false );
767
+ $ helper ->href = $ this ->context ->link ->getAdminLink ('AdminCustomers ' ).'&customerFilter_deleted=1 ' ;
756
768
$ helper ->source = $ this ->context ->link ->getAdminLink ('AdminStats ' ).'&ajax=1&action=getKpi&kpi=total_banned_customers ' ;
757
769
$ helper ->tooltip = $ this ->l ('The total number of banned customers. ' , null , null , false );
758
770
$ kpis [] = $ helper ;
@@ -962,7 +974,7 @@ public function processDelete()
962
974
if (Validate::isLoadedObject ($ objCustomer = $ this ->loadObject ())) {
963
975
if ($ this ->delete_mode == 'real ' && Order::getCustomerOrders ($ objCustomer ->id , true )) {
964
976
$ objCustomer ->email = 'anonymous ' .'- ' .$ objCustomer ->id .'@ ' .Tools::link_rewrite (Configuration::get ('PS_SHOP_NAME ' )).'_anonymous.com ' ;
965
- $ objCustomer ->deleted = 1 ;
977
+ $ objCustomer ->deleted = Customer:: STATUS_DELETED ;
966
978
if (!$ objCustomer ->update ()) {
967
979
$ this ->errors [] = Tools::displayError ('Some error ocurred while deleting the Customer ' );
968
980
return ;
@@ -1003,7 +1015,7 @@ protected function processBulkDelete()
1003
1015
// check if customer has orders for email change else customer will be deleted
1004
1016
if (Order::getCustomerOrders ($ objCustomer ->id , true )) {
1005
1017
$ objCustomer ->email = 'anonymous ' .'- ' .$ objCustomer ->id .'@ ' .Tools::getShopDomain ();
1006
- $ objCustomer ->deleted = 1 ;
1018
+ $ objCustomer ->deleted = Customer:: STATUS_DELETED ;
1007
1019
if ($ objCustomer ->update ()) {
1008
1020
// unset the customer which is processed
1009
1021
// not processed customers will be deleted with default process if no errors are there
0 commit comments