Updated the varilable names and removed non required code
This commit is contained in:
@@ -140,15 +140,15 @@ class CategoryControllerCore extends FrontController
|
||||
|
||||
$id_category = Tools::getValue('id_category');
|
||||
|
||||
$displayAllRooms = false;
|
||||
$displayAllRoomsTypes = false;
|
||||
if (!($date_from = Tools::getValue('date_from'))) {
|
||||
$date_from = date('Y-m-d');
|
||||
$date_to = date('Y-m-d', strtotime($date_from) + 86400);
|
||||
$displayAllRooms = true;
|
||||
$displayAllRoomsTypes = true;
|
||||
}
|
||||
if (!($date_to = Tools::getValue('date_to'))) {
|
||||
$date_to = date('Y-m-d', strtotime($date_from) + 86400);
|
||||
$displayAllRooms = true;
|
||||
$displayAllRoomsTypes = true;
|
||||
}
|
||||
|
||||
// get occupancy of the search
|
||||
@@ -183,8 +183,8 @@ class CategoryControllerCore extends FrontController
|
||||
'id_guest' => $id_guest,
|
||||
);
|
||||
|
||||
if ($displayAllRooms) {
|
||||
$bookingParams['room_info_detailed'] = 1;
|
||||
if ($displayAllRoomsTypes) {
|
||||
$bookingParams['display_all_room_types'] = 1;
|
||||
}
|
||||
|
||||
$booking_data = $objBookingDetail->dataForFrontSearch($bookingParams);
|
||||
@@ -214,7 +214,7 @@ class CategoryControllerCore extends FrontController
|
||||
'booking_data' => $booking_data,
|
||||
'max_order_date' => $max_order_date,
|
||||
'order_date_restrict' => $order_date_restrict,
|
||||
'display_all_rooms' => $displayAllRooms
|
||||
'display_all_room_types' => $displayAllRoomsTypes
|
||||
));
|
||||
} else {
|
||||
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
|
||||
@@ -269,16 +269,16 @@ class CategoryControllerCore extends FrontController
|
||||
$this->display_header = false;
|
||||
$this->display_footer = false;
|
||||
|
||||
$displayAllRooms = false;
|
||||
$displayAllRoomsTypes = false;
|
||||
if (!($date_from = Tools::getValue('date_from'))) {
|
||||
$date_from = date('Y-m-d H:i:s');
|
||||
$date_to = date('Y-m-d H:i:s', strtotime($date_from) + 86400);
|
||||
$displayAllRooms = true;
|
||||
$displayAllRoomsTypes = true;
|
||||
}
|
||||
|
||||
if (!($date_to = Tools::getValue('date_to'))) {
|
||||
$date_to = date('Y-m-d H:i:s', strtotime($date_from) + 86400);
|
||||
$displayAllRooms = true;
|
||||
$displayAllRoomsTypes = true;
|
||||
}
|
||||
|
||||
$htl_id_category = Tools::getValue('id_category');
|
||||
@@ -335,8 +335,8 @@ class CategoryControllerCore extends FrontController
|
||||
'id_guest' => $this->context->cookie->id_guest,
|
||||
);
|
||||
|
||||
if ($displayAllRooms) {
|
||||
$bookingParams['room_info_detailed'] = 1;
|
||||
if ($displayAllRoomsTypes) {
|
||||
$bookingParams['display_all_room_types'] = 1;
|
||||
}
|
||||
|
||||
$booking_data = $objBookingDetail->dataForFrontSearch($bookingParams);
|
||||
|
||||
@@ -242,10 +242,6 @@ class HotelBookingDetail extends ObjectModel
|
||||
$params['full_detail'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($params['room_info_detailed'])) {
|
||||
$params['room_info_detailed'] = 0;
|
||||
}
|
||||
|
||||
Hook::exec('actionBookingDataParamsModifier', array('params' => &$params));
|
||||
|
||||
return $params;
|
||||
@@ -1710,7 +1706,8 @@ class HotelBookingDetail extends ObjectModel
|
||||
unset($bookingData['rm_data'][$key]);
|
||||
continue;
|
||||
}
|
||||
if (count($value['data']['available']) || $room_info_detailed) {
|
||||
|
||||
if (count($value['data']['available']) || (isset($display_all_room_types) && $display_all_room_types)) {
|
||||
$prod_price = Product::getPriceStatic($value['id_product'], self::useTax());
|
||||
$productPriceWithoutReduction = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay($value['id_product'], $date_from, $date_to, self::useTax(), 0, 0, 0, 0, 1, 0);
|
||||
$cover_image_arr = Product::getCover($value['id_product']);
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
{block name='occupancy_field_actions'}
|
||||
<div class="occupancy_block_actions">
|
||||
<span class="add_occupancy_block">
|
||||
<a class="add_new_occupancy_btn {if isset($occupancies) && $occupancies && isset($total_available_rooms) && $total_available_rooms <= count($occupancies) || isset($display_all_rooms) && $display_all_rooms} disabled{/if}" data-title-available="{l s='Click to add more rooms.'}" data-title-unavailable="{l s='No more rooms available.'}" href="#">
|
||||
<a class="add_new_occupancy_btn {if isset($occupancies) && $occupancies && isset($total_available_rooms) && $total_available_rooms <= count($occupancies)} disabled{/if}" data-title-available="{l s='Click to add more rooms.'}" data-title-unavailable="{l s='No more rooms available.'}" href="#">
|
||||
<i class="icon-plus"></i>
|
||||
<span>{l s='Add Room'}</span>
|
||||
</a>
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
{block name='displayRoomTypeListBefore'}
|
||||
{hook h='displayRoomTypeListBefore'}
|
||||
{/block}
|
||||
{if isset($booking_data['stats']) && $booking_data['stats']['num_avail'] || isset($display_all_rooms) && $display_all_rooms}
|
||||
{if isset($booking_data['stats']) && $booking_data['stats']['num_avail'] || isset($display_all_room_types) && $display_all_room_types}
|
||||
{foreach from=$booking_data['rm_data'] key=room_k item=room_v}
|
||||
{if $room_v['data']['available']|count || isset($display_all_rooms) && $display_all_rooms }
|
||||
{if $room_v['data']['available']|count || isset($display_all_room_types) && $display_all_room_types }
|
||||
<div class="col-sm-12 room_cont" data-id-product="{$room_v['id_product']|escape:'htmlall':'UTF-8'}">
|
||||
<div class="row">
|
||||
{block name='room_type_list_room_image'}
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="row">
|
||||
<p class="rm_heading col-sm-12 col-md-7">{$room_v['name']|escape:'htmlall':'UTF-8'}</p>
|
||||
{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE && !$order_date_restrict}
|
||||
<p class="rm_left col-sm-12 col-md-5" {if isset($display_all_rooms) && $display_all_rooms || $room_v['room_left'] > $warning_num} style="display:none"{/if}>
|
||||
<p class="rm_left col-sm-12 col-md-5" {if isset($display_all_room_types) && $display_all_room_types || $room_v['room_left'] > $warning_num} style="display:none"{/if}>
|
||||
{l s='Hurry!'} <span class="remain_rm_qty">{$room_v['room_left']|escape:'htmlall':'UTF-8'}</span> {l s='rooms left'}
|
||||
</p>
|
||||
{/if}
|
||||
@@ -70,7 +70,7 @@
|
||||
{/block}
|
||||
{block name='room_type_list_room_price'}
|
||||
<div class="col-sm-12 col-md-7 col-lg-6">
|
||||
{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE && !$order_date_restrict && (!isset($display_all_rooms) || !$display_all_rooms)}
|
||||
{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE && !$order_date_restrict && (!isset($display_all_room_types) || !$display_all_room_types)}
|
||||
<p class="rm_price_cont">
|
||||
{if $room_v['feature_price_diff'] >= 0}
|
||||
<span class="rm_price_val {if $room_v['feature_price_diff']>0}room_type_old_price{/if}">
|
||||
@@ -97,7 +97,7 @@
|
||||
<div class="col-sm-12 col-md-6 col-lg-8">
|
||||
{block name='room_type_list_room_booking_fields'}
|
||||
{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE && !$order_date_restrict}
|
||||
{if (!isset($display_all_rooms) || !$display_all_rooms)}
|
||||
{if (!isset($display_all_room_types) || !$display_all_room_types)}
|
||||
<div class="booking_room_fields">
|
||||
{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}
|
||||
<div class="booking_guest_occupancy_conatiner">
|
||||
|
||||
Reference in New Issue
Block a user