update room type default date to when LOS is applied

This commit is contained in:
Shreesh Arora
2023-09-27 15:40:38 +05:30
parent ce93a9826f
commit 3353fdfd31

View File

@@ -327,10 +327,16 @@ class ProductControllerCore extends FrontController
if (!($date_from = Tools::getValue('date_from'))) {
$date_from = date('Y-m-d');
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_from)));
// set date to according to los
$objHotelRoomTypeRestrictionDateRange = new HotelRoomTypeRestrictionDateRange();
$los = $objHotelRoomTypeRestrictionDateRange->getRoomTypeLengthOfStay($this->product->id, $date_from);
$date_to = date('Y-m-d', strtotime('+'.$los['min_los'].' day', strtotime($date_from)));
}
if (!($date_to = Tools::getValue('date_to'))) {
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_from)));
// set date to according to los
$objHotelRoomTypeRestrictionDateRange = new HotelRoomTypeRestrictionDateRange();
$los = $objHotelRoomTypeRestrictionDateRange->getRoomTypeLengthOfStay($this->product->id, $date_from);
$date_to = date('Y-m-d', strtotime('+'.$los['min_los'].' day', strtotime($date_from)));
}
$hotel_branch_obj = new HotelBranchInformation($hotel_id);