updated some function names according to their working

This commit is contained in:
vishalsingh.qlo325
2025-03-18 17:40:24 +05:30
parent bc7339e073
commit dd9d4be23e
3 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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