Merge pull request #1514 from vishal-singh-webkul/gli-2739

Fixed: The bed types are not adding with room type for new and duplicate room type creation in back-office
This commit is contained in:
Rohit Jain
2025-06-24 17:58:55 +05:30
committed by GitHub

View File

@@ -944,6 +944,12 @@ class AdminProductsControllerCore extends AdminController
$id_hotel_new = $room_type_info['id_hotel'];
}
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
if ($roomTypeBedTypes = $objHotelRoomTypeBedType->getRoomTypeBedTypes($id_product_old)) {
$roomTypeBedTypes = array_column($roomTypeBedTypes, 'id_bed_type');
$objHotelRoomTypeBedType->updateRoomTypeBedTypes($roomTypeBedTypes, $product->id);
}
if ($product->hasAttributes()) {
Product::updateDefaultAttribute($product->id);
} else {
@@ -1918,7 +1924,8 @@ class AdminProductsControllerCore extends AdminController
$this->copyFromPost($this->object, $this->table);
$this->object->booking_product = true;
if ($this->object->add()) {
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
$objHotelRoomTypeBedType->updateRoomTypeBedTypes(Tools::getValue('id_bed_types'), $this->object->id);
// associateroom type to hotel
// if ($this->object->is_virtual) {