Fixed the booking dates incase prepration time is applied to the hotel
This commit is contained in:
@@ -344,10 +344,6 @@ class ProductControllerCore extends FrontController
|
||||
$preparationTime = (int) HotelOrderRestrictDate::getPreparationTime($hotel_id);
|
||||
if (!($date_from = Tools::getValue('date_from'))) {
|
||||
$date_from = date('Y-m-d');
|
||||
if ($preparationTime) {
|
||||
$date_from = date('Y-m-d', strtotime('+ '.$preparationTime.' day'));
|
||||
}
|
||||
|
||||
// set date to according to los
|
||||
$objHotelRoomTypeRestrictionDateRange = new HotelRoomTypeRestrictionDateRange();
|
||||
$los = $objHotelRoomTypeRestrictionDateRange->getRoomTypeLengthOfStay($this->product->id, $date_from);
|
||||
@@ -360,6 +356,17 @@ class ProductControllerCore extends FrontController
|
||||
$date_to = date('Y-m-d', strtotime('+'.$los['min_los'].' day', strtotime($date_from)));
|
||||
}
|
||||
|
||||
if ($preparationTime
|
||||
&& strtotime('+ '.$preparationTime.' day') >= strtotime($date_from)
|
||||
) {
|
||||
$date_from = date('Y-m-d', strtotime('+ '.$preparationTime.' day'));
|
||||
if (strtotime($date_from) >= strtotime($date_to)) {
|
||||
$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);
|
||||
/*Max date of ordering for order restrict*/
|
||||
$order_date_restrict = false;
|
||||
|
||||
Reference in New Issue
Block a user