From 5f908d61779629354572a0a32d4510637066e89e Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 28 Jun 2024 17:34:11 +0530 Subject: [PATCH] Fixed: Admin cannot permanently delete customers with bookings on localhost. --- controllers/admin/AdminCustomersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 6c763f10c..520afd0c3 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -958,7 +958,7 @@ class AdminCustomersControllerCore extends AdminController // If customer is going to be deleted permanently then if customer has orders the change this customer as an anonymous customer if (Validate::isLoadedObject($objCustomer = $this->loadObject())) { if ($this->delete_mode == 'real' && Order::getCustomerOrders($objCustomer->id, true)) { - $objCustomer->email = 'anonymous'.'-'.$objCustomer->id.'@'.Tools::getShopDomain(); + $objCustomer->email = 'anonymous'.'-'.$objCustomer->id.'@'.Tools::link_rewrite(Configuration::get('PS_SHOP_NAME')).'_anonymous.com'; $objCustomer->deleted = 1; if (!$objCustomer->update()) { $this->errors[] = Tools::displayError('Some error ocurred while deleting the Customer');