Fixed: After reallocation getting issue on cart page on realloation for second time

This commit is contained in:
vishalsingh.qlo325
2025-06-23 11:41:51 +05:30
parent 5c628d9a10
commit 004c2a4bf6
3 changed files with 7 additions and 9 deletions

View File

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

View File

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

View File

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