Fixed: Product with selling preference hotel standalone and with room_type, removes from cart when added with a room type without option

This commit is contained in:
Sumit Panwar
2025-06-14 19:24:48 +05:30
parent faf7ab6d49
commit 75bc2fe569

View File

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