From 75bc2fe569b5be9ddd56bd7062ece1edd329e364 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Sat, 14 Jun 2025 19:24:48 +0530 Subject: [PATCH] Fixed: Product with selling preference hotel standalone and with room_type, removes from cart when added with a room type without option --- .../classes/HotelCartBookingData.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/classes/HotelCartBookingData.php b/modules/hotelreservationsystem/classes/HotelCartBookingData.php index 8a7a1d2c0..e99c73e3a 100644 --- a/modules/hotelreservationsystem/classes/HotelCartBookingData.php +++ b/modules/hotelreservationsystem/classes/HotelCartBookingData.php @@ -987,7 +987,12 @@ class HotelCartBookingData extends ObjectModel } } else { if (ServiceProductOption::productHasOptions($service['id_product'])) { - if (!Validate::isLoadedObject(new ServiceProductOption($service['id_product_option']))) { + if ($product->selling_preference_type == Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE + && $service['id_hotel_cart_booking'] + ) { + // do nothing if service of type SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE is added with toom type + // then we will not check for options + } elseif (!Validate::isLoadedObject(new ServiceProductOption($service['id_product_option']))) { $toRemoveService = 1; } } elseif ($service['id_product_option']) {