From dd9d4be23ead5aa89e79b5babea3d56ebcdaedef Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 18 Mar 2025 17:40:24 +0530 Subject: [PATCH] updated some function names according to their working --- classes/CustomerGuestDetail.php | 6 +++--- controllers/admin/AdminCustomersController.php | 2 +- controllers/front/OrderOpcController.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/CustomerGuestDetail.php b/classes/CustomerGuestDetail.php index 32f3eb63b..2bc07b422 100644 --- a/classes/CustomerGuestDetail.php +++ b/classes/CustomerGuestDetail.php @@ -83,10 +83,10 @@ class CustomerGuestDetailCore extends ObjectModel return parent::delete(); } - public function deleteCartCustomerGuestByIdCustomer($idCustomer, $offset = 0) + public function deleteCustomerGuestByIdCustomer($idCustomer, $offset = 0) { $res = true; - if ($guests = $this->getCustomerRelatedGuestDetails($idCustomer, false, false, false, $offset)) { + if ($guests = $this->getCustomerGuestsByIdCustomer($idCustomer, false, false, false, $offset)) { foreach ($guests as $guest) { $objCustomerGuestDetail = new CustomerGuestDetail((int) $guest['id_customer_guest_detail']); $objCustomerGuestDetail->delete(); @@ -96,7 +96,7 @@ class CustomerGuestDetailCore extends ObjectModel return $res; } - public function getCustomerRelatedGuestDetails($idCustomer, $firstname = false, $lastname = false, $email = false, $offset = 0) + public function getCustomerGuestsByIdCustomer($idCustomer, $firstname = false, $lastname = false, $email = false, $offset = 0) { return Db::getInstance()->executeS(' SELECT cgd.`id_customer_guest_detail`, cgd.`email`, cgd.`firstname`, cgd.`lastname`, cgd.`phone` diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 381a7cde2..b9523a9bc 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -941,7 +941,7 @@ class AdminCustomersControllerCore extends AdminController $shop = new Shop($customer->id_shop); $objCustomerGuestDetail = new CustomerGuestDetail(); - $customerGuests = $objCustomerGuestDetail->getCustomerRelatedGuestDetails($customer->id); + $customerGuests = $objCustomerGuestDetail->getCustomerGuestsByIdCustomer($customer->id); $this->tpl_view_vars = array( 'customer' => $customer, 'gender' => $gender, diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index 063ed9494..ac66b6486 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -1081,7 +1081,7 @@ class OrderOpcControllerCore extends ParentOrderController $lastname = trim(Tools::getValue('lastname')); $email = trim(Tools::getValue('email')); $objCustomerGuestDetail = new CustomerGuestDetail(); - if ($guestDetails = $objCustomerGuestDetail->getCustomerRelatedGuestDetails( + if ($guestDetails = $objCustomerGuestDetail->getCustomerGuestsByIdCustomer( $this->context->cart->id_customer, $firstname, $lastname, @@ -1167,7 +1167,7 @@ class OrderOpcControllerCore extends ParentOrderController $objCustomerGuestDetail->id_customer = $this->context->customer->id; if ($objCustomerGuestDetail->save()) { if ($maxGuestAccountAllowed = Configuration::get('PS_CUSTOMER_GUEST_MAX_NUM')) { - $objCustomerGuestDetail->deleteCartCustomerGuestByIdCustomer($this->context->cart->id_customer, $maxGuestAccountAllowed); + $objCustomerGuestDetail->deleteCustomerGuestByIdCustomer($this->context->cart->id_customer, $maxGuestAccountAllowed); } // To prevent duplications for the same cart. CustomerGuestDetail::deleteCartCustomerGuest($this->context->cart->id);