Updated: Date format in hotel booking demands and removed non required validation from validateCartBookings() function.

This commit is contained in:
Rohit Jain
2025-02-19 15:51:20 +05:30
committed by GitHub
3 changed files with 4 additions and 6 deletions

View File

@@ -103,8 +103,8 @@ class HotelBookingDemands extends ObjectModel
$sql .= ' AND hb.`id_room`='.(int)$idRoom;
}
if ($dateFrom && $dateTo) {
$dateFrom = date('Y-m-d', strtotime($dateFrom));
$dateTo = date('Y-m-d', strtotime($dateTo));
$dateFrom = date('Y-m-d H:i:s', strtotime($dateFrom));
$dateTo = date('Y-m-d H:i:s', strtotime($dateTo));
$sql .= ' AND hb.`date_from`=\''.pSQL($dateFrom).'\' AND hb.`date_to`= \''.pSQL($dateTo).'\'';
}

View File

@@ -1032,9 +1032,7 @@ class HotelCartBookingData extends ObjectModel
$preparationTime = HotelOrderRestrictDate::getPreparationTime($roomData['id_hotel']);
if ($preparationTime !== false) {
$minOrderDate = date('Y-m-d', strtotime('+'. ($preparationTime) .' days'));
if (strtotime($minOrderDate) > strtotime($roomData['date_from'])
|| strtotime($minOrderDate . ' +1 day')> strtotime($roomData['date_to'])
) {
if (strtotime($minOrderDate) > strtotime($roomData['date_from'])) {
$objHotelBranchInformation = new HotelBranchInformation(
$roomData['id_hotel'],
$context->language->id

View File

@@ -939,7 +939,7 @@ var ajaxCart = {
content += '<td class="num_rooms_in_date">' + date_diff_v.num_rm + '</td>';
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount) + parseFloat(date_diff_v.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
content += '<td>';
content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v.amount + ' id_product=' + productId + ' date_from=' + date_diff_v.data_form + ' date_to=' + date_diff_v.data_to + ' num_rooms=' + date_diff_v.num_rm + ' title="' + remove_rm_title + '"></a>';
content += '<a class="remove_rooms_from_cart_link" href="#" rm_price="' + date_diff_v.amount + '" id_product="' + productId + '" date_from="' + date_diff_v.data_form + '" date_to="' + date_diff_v.data_to + '" num_rooms="' + date_diff_v.num_rm + '" title="' + remove_rm_title + '"></a>';
content += '</td>';
content += '</tr>';
});