diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 41070e81b..793a95b36 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -397,12 +397,7 @@ class AdminOrdersControllerCore extends AdminController $cart_detail_data = array(); $cart_detail_data_obj = new HotelCartBookingData(); $objServiceProductCartDetail = new ServiceProductCartDetail(); - if ($cart_detail_data = $cart_detail_data_obj->getCartFormatedBookinInfoByIdCart( - (int) $id_cart, - [], - null, - 0 - )) { + if ($cart_detail_data = $cart_detail_data_obj->getCartFormatedBookinInfoByIdCart((int) $id_cart)) { $objRoomType = new HotelRoomType(); foreach ($cart_detail_data as $key => $cart_data) { $cart_detail_data[$key]['room_type_info'] = $objRoomType->getRoomTypeInfoByIdProduct($cart_data['id_product']); diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 83bda26ff..f25b204fb 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -2293,7 +2293,7 @@ class HotelBookingDetail extends ObjectModel if ($idNewCartBookingData) { $objServiceProductCartDetail = new ServiceProductCartDetail(); if ($oldCartAdditonalServices = $objServiceProductCartDetail->getServiceProductsInCart( - $objCartBookingData->id_cart, + 0, // if reallocated twice the id cart will not be used as it was not changed in first reallocation. [], null, $objCartBookingData->id diff --git a/modules/hotelreservationsystem/classes/ServiceProductCartDetail.php b/modules/hotelreservationsystem/classes/ServiceProductCartDetail.php index 2b7eb6aa0..7c033fe24 100644 --- a/modules/hotelreservationsystem/classes/ServiceProductCartDetail.php +++ b/modules/hotelreservationsystem/classes/ServiceProductCartDetail.php @@ -140,7 +140,7 @@ class ServiceProductCartDetail extends ObjectModel */ // public function getProducts( public function getServiceProductsInCart( - $idCart, + $idCart = 0, $sellingPreferenceTypes = [], $idHotel = null, $idHotelCartBooking = null, @@ -179,7 +179,10 @@ class ServiceProductCartDetail extends ObjectModel $sql .= ' LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil ON (hbil.`id` = spc.`id_hotel` AND hbil.`id_lang` = '. $language->id.')'; } - $sql .= ' WHERE spc.`id_product`!=0 AND spc.`id_cart`='.(int) $idCart; + $sql .= ' WHERE spc.`id_product`!=0 '; + if ($idCart) { + $sql .= ' AND spc.`id_cart`='.(int) $idCart; + } if (!is_null($idProductRoomType)) { $sql .= ' AND hcbd.`id_product`='.(int) $idProductRoomType;