Hotel Raxa - Advanced Booking System Implementation

🏨 Hotel Booking Enhancements:
- Implemented Eagle Booking Advanced Pricing add-on
- Added Booking.com-style rate management system
- Created professional calendar interface for pricing
- Integrated deals and discounts functionality

💰 Advanced Pricing Features:
- Dynamic pricing models (per room, per person, per adult)
- Base rates, adult rates, and child rates management
- Length of stay discounts and early bird deals
- Mobile rates and secret deals implementation
- Seasonal promotions and flash sales

📅 Availability Management:
- Real-time availability tracking
- Stop sell and restriction controls
- Closed to arrival/departure functionality
- Minimum/maximum stay requirements
- Automatic sold-out management

💳 Payment Integration:
- Maintained Redsys payment gateway integration
- Seamless integration with existing Eagle Booking
- No modifications to core Eagle Booking plugin

🛠️ Technical Implementation:
- Custom database tables for advanced pricing
- WordPress hooks and filters integration
- AJAX-powered admin interface
- Data migration from existing Eagle Booking
- Professional calendar view for revenue management

📊 Admin Interface:
- Booking.com-style management dashboard
- Visual rate and availability calendar
- Bulk operations for date ranges
- Statistics and analytics dashboard
- Modal dialogs for quick editing

🔧 Code Quality:
- WordPress coding standards compliance
- Secure database operations with prepared statements
- Proper input validation and sanitization
- Error handling and logging
- Responsive admin interface

🤖 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Hotel Raxa Dev
2025-07-11 07:43:22 +02:00
commit 5b1e2453c7
9816 changed files with 2784509 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
<?php
/**
* The Template for displaying filters
*
* This template can be overridden by copying it to yourtheme/eb-templates/search/filters.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.6
*/
defined('ABSPATH') || exit;
?>
<div class="search-filters <?php if ( eb_get_option('eb_search_page_sticky_sidebar') == true ) echo 'sticky-sidebar'; ?>">
<div class="eb-widget eb-search-form">
<h2 class="title"><?php echo __('Booking Details','eagle-booking') ?></h2>
<div class="inner">
<form id="search_form" class="booking-search-form">
<?php
/**
* Include Dates Picker
*/
include eb_load_template('elements/dates-picker.php');
?>
<?php
/**
* Include Guests Picker
*/
include eb_load_template('elements/guests-picker.php');
?>
</form>
</div>
</div>
<?php
/**
* Include Sortable Filters
*/
$eb_search_filters = eb_get_option('eagle_booking_search_page_settings');
if ( $eb_search_filters ) { foreach ($eb_search_filters as $eb_search_filter=>$value) {
switch($eb_search_filter) {
case 'price_range_filter': if ($value == 1) include eb_load_template('search/filters/price.php');
break;
case 'services_filter': if ($value == 1) include eb_load_template('search/filters/services.php');
break;
case 'additional_services_filter': if ($value == 1) include eb_load_template('search/filters/additional-services.php');
break;
case 'branches': if ($value == 1) include eb_load_template('search/filters/branches.php');
break;
}
}
}
?>
</div>

View File

@@ -0,0 +1,28 @@
<div class="eb-widget eb-additional-services scroll">
<h2 class="title"><?php echo __('Additional Services','eagle-booking') ?></h2>
<div class="inner">
<?php
// ADDITIONAL SERVICES QRY
$eagle_booking_additional_services_args = array(
'posts_per_page' => -1,
'post_type'=> 'eagle_services',
'meta_query' => array(
array(
'key' => 'eagle_booking_mtb_service_type',
'value' => 'additional',
'compare' => '=',
)
)
);
$eagle_booking_additional_services_query = new WP_Query( $eagle_booking_additional_services_args );
?>
<?php while ( $eagle_booking_additional_services_query->have_posts() ) : $eagle_booking_additional_services_query->the_post(); ?>
<div class="service">
<input id="<?php echo get_the_ID() ?>" class="eb_checkbox_additional_service" type="checkbox" value="<?php echo get_the_ID() ?>,">
<label for="<?php echo get_the_ID() ?>" ><?php echo get_the_title() ?></label>
</div>
<?php endwhile; wp_reset_postdata(); ?>
<input type="hidden" id="eb_additional_services" value="">
</div>
</div>

View File

@@ -0,0 +1,56 @@
<div class="eb-widget eb-branches">
<h2 class="title"><?php echo __('Branch','eagle-booking') ?> </h2>
<div class="inner">
<?php
$args = array(
'taxonomy' => 'eagle_branch',
'hide_empty' => true,
);
$branch_query = new WP_Term_Query($args);
if (!empty($branch_query->terms)) {
foreach ($branch_query->terms as $eb_branch) {
$eb_branch_id = $eb_branch->term_id;
$eb_branch_name = get_term_field( 'name', $eb_branch );
$eb_branch_logo = get_term_meta( $eb_branch_id, 'eb_branch_logo', true );
$eb_branch_url = get_term_link($eb_branch_id);
if ( $eb_branch_id == $eb_selected_branch ) {
echo '<div class="eb-branch-filter selected">';
echo '<input type="checkbox" class="eb-branch-checkbox" value="'.$eb_branch_id.'" checked>';
} else {
echo '<div class="eb-branch-filter">';
echo '<input type="checkbox" class="eb-branch-checkbox" value="'.$eb_branch_id.'">';
}
if ( $eb_branch_logo ) {
echo '<img src="'.$eb_branch_logo.'" alt="'.esc_html($eb_branch_name).'">';
} else {
echo esc_html($eb_branch_name);
}
echo '<a href="'.esc_url($eb_branch_url).'" target="_blank" class="eb-branch-filter-link"><i class="far fa-question-circle"></i></a>';
echo '</div>';
}
}
?>
<input type="hidden" id="eb_branch" value="<?php echo $eb_selected_branch ?>">
</div>
</div>

View File

@@ -0,0 +1,8 @@
<div class="eb-widget eb-price-range">
<h2 class="title"><?php echo __('Price','eagle-booking') ?> </h2>
<div class="inner">
<input type="hidden" id="eagle_booking_slider_range" class="js-range-slider">
<input type="hidden" id="eagle_booking_min_price" name="eagle_booking_min_price" value="<?php echo eb_get_option('eb_price_range_min') ?>">
<input type="hidden" id="eagle_booking_max_price" name="eagle_booking_max_price" value="<?php echo eb_get_option('eb_price_range_max') ?>">
</div>
</div>

View File

@@ -0,0 +1,27 @@
<div class="eb-widget eb-services scroll">
<h2 class="title"><?php echo __('Included Services','eagle-booking') ?> </h2>
<div class="inner">
<?php
// SERVICES QRY
$eagle_booking_services_args = array(
'posts_per_page' => -1,
'post_type'=> 'eagle_services',
'meta_query' => array(
array(
'key' => 'eagle_booking_mtb_service_type',
'value' => 'normal',
'compare' => '=',
)
)
);
$eagle_booking_services_query = new WP_Query( $eagle_booking_services_args );
?>
<?php while ( $eagle_booking_services_query->have_posts() ) : $eagle_booking_services_query->the_post(); ?>
<div class="service">
<input type="checkbox" id="<?php echo get_the_ID() ?>" class="eb_normal_service" value="<?php echo get_the_ID() ?>,">
<label for="<?php echo get_the_ID() ?>"> <?php echo get_the_title() ?></label>
</div>
<?php endwhile; wp_reset_postdata(); ?>
<input type="hidden" id="eb_normal_services" value="">
</div>
</div>

View File

@@ -0,0 +1,30 @@
<?php
/**
* The Template for displaying pagination
*
* This template can be overridden by copying it to yourtheme/eb-templates/search/pagination.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.5
*/
defined('ABSPATH') || exit;
?>
<?php if ( $eagle_booking_results_qnt > $eagle_booking_rooms_per_page ) : ?>
<div class="eb-pagination">
<?php for ($eagle_booking_i_pagination = 1; $eagle_booking_i_pagination <= $eagle_booking_qnt_pagination; $eagle_booking_i_pagination++) : ?>
<?php if ( $eagle_booking_i_pagination == $eagle_booking_paged ){ $eagle_booking_class_pagination_active = 'current'; } else { $eagle_booking_class_pagination_active = ''; } ?>
<a class="pagination-button <?php echo $eagle_booking_class_pagination_active ?>" data-pagination="<?php echo $eagle_booking_i_pagination ?>">
<?php echo $eagle_booking_i_pagination ?>
</a>
<?php endfor ?>
</div>
<?php endif ?>

View File

@@ -0,0 +1,81 @@
<?php
/**
* The Template for displaying room
*
* This template can be overridden by copying it to yourtheme/eb-templates/search/room.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.7
*/
defined('ABSPATH') || exit;
// Defaults
$eb_room_title = get_the_title();
$eb_room_id = get_the_ID();
$eb_room_url = get_permalink( $eb_room_id );
// Metabaxes
$eb_room_description = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_description', true );
$eb_room_featured = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_featured', true );
$eb_min_booking_nights = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_min_booking_nights', true );
$eb_max_booking_nights = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_max_booking_nights', true );
if ( empty($eb_min_booking_nights) ) $eb_min_booking_nights = 1;
if ( empty($eb_max_booking_nights) ) $eb_max_booking_nights = 1000;
?>
<div id="eb-search-room-<?php echo esc_attr($eb_room_id) ?>" class="room-list-item">
<div class="room-list-item-grid">
<figure>
<a href="<?php echo esc_url($eb_room_url) ?>">
<?php if ($eb_room_featured == true) : ?>
<span class="featured-room"><i class="fa fa-star"></i><?php echo __('Featured', 'eagle-booking') ?></span>
<?php endif ?>
<?php if ( has_post_thumbnail() ) : ?>
<img src="<?php echo eagle_booking_get_room_img_url($eb_room_id, 'eagle_booking_image_size_720_470') ?>" alt="<?php echo esc_html($eb_room_title) ?>" loading="lazy">
<?php else : ?>
<div class="room-no-image"><?php echo __('No image available', 'eagle-booking' ) ?></div>
<?php endif ?>
</a>
</figure>
<div class="room-details">
<h2 class="title">
<a href="<?php echo get_permalink($eb_room_id) ?>"><?php echo esc_html($eb_room_title) ?></a>
</h2>
<p><?php echo esc_html($eb_room_description) ?></p>
<?php
/**
* Include Services
*/
if ( eb_get_option('eb_search_services') == true ) {
include eb_load_template('search/room/services.php');
}
?>
</div>
<?php
/**
* Include Price
*/
include eb_load_template('search/room/price.php')
?>
</div>
<?php
/**
* Include Quick Details
*/
if ( eb_get_option('eb_search_quick_details') == true ) {
include eb_load_template('search/room/quick-details.php');
}
?>
</div>

View File

@@ -0,0 +1,209 @@
<?php
/**
* The Template for displaying room price
*
* This template can be overridden by copying it to yourtheme/eb-templates/search/price.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.8
*/
defined('ABSPATH') || exit;
?>
<div class="room-price-details">
<div class="room-price-search">
<?php
/**
* Room Price
*/
eb_room_price( $eb_room_id, __('per night', 'eagle-booking') );
/**
* Room ID based on used multi-language plugin (WPML or Polylang)
*/
if ( function_exists('wpml_loaded') ) {
$eb_room_id_availability = apply_filters('wpml_object_id', $eb_room_id, 'eagle_rooms', true, apply_filters('wpml_default_language', NULL ));
} elseif ( function_exists('pll_the_languages') ) {
$eb_room_id_availability = pll_get_post( $eb_room_id, pll_default_language() );
} else {
$eb_room_id_availability = get_the_ID() ;
}
/**
* Room Availability
*/
if ( eb_room_is_available_block( $eb_room_id_availability, $eagle_booking_checkin, $eagle_booking_checkout ) && eagle_booking_is_qnt_available( eb_room_availability( $eb_room_id_availability, $eagle_booking_checkin, $eagle_booking_checkout ), $eagle_booking_checkin, $eagle_booking_checkout, $eb_room_id ) == 1 ) {
$eb_booking_nights = eb_total_booking_nights($eagle_booking_checkin, $eagle_booking_checkout);
// Room is Available
if ( $eb_booking_nights >= $eb_min_booking_nights && $eb_booking_nights <= $eb_max_booking_nights ) {
$eb_trip_price = 0;
$eagle_booking_index = 1;
$eagle_booking_date_cicle = $eagle_booking_checkin;
while ($eagle_booking_index <= eb_total_booking_nights($eagle_booking_checkin, $eagle_booking_checkout)) :
// Price Type
$eb_room_price_type = get_post_meta($eb_room_id, 'eagle_booking_mtb_room_price_type', true);
// Charge based on room price x booking nights x guests number
if ($eb_room_price_type === 'room_price_nights_guests') {
// Adults & children option is enabled
if ( eb_get_option('eb_adults_children') == true ) {
// Calculate the total price
$eb_trip_price = $eb_trip_price + eb_room_total_price($eb_room_id, $eagle_booking_date_cicle) * ($eagle_booking_adults + $eagle_booking_children);
} else {
// Calculate the total price
$eb_trip_price = $eb_trip_price + eb_room_total_price($eb_room_id, $eagle_booking_date_cicle) * $eagle_booking_guests;
}
// Charge bades on guests or adults & children price
} elseif ($eb_room_price_type === 'room_price_nights_guests_custom') {
// Adults & children option is enabled
if ( eb_get_option('eb_adults_children') == true ) {
$eb_adults_price = get_post_meta($eb_room_id, 'eagle_booking_mtb_room_adult_price', true) ?: 0;
$eb_adults_price_start = get_post_meta($eb_room_id, 'eagle_booking_mtb_room_adults_price_start', true) ?: 0;
$eb_children_price = get_post_meta($eb_room_id, 'eagle_booking_mtb_room_children_price', true) ?: 0;
$eb_children_price_start = get_post_meta($eb_room_id, 'eagle_booking_mtb_room_children_price_start', true) ?: 0;
// Adults total custom price
if ($eagle_booking_adults < $eb_adults_price_start) {
$eb_adults_price_total = 0;
} else {
$eb_adults_price_total = $eb_adults_price * ($eagle_booking_adults - $eb_adults_price_start);
}
// Children total custom price
if ($eagle_booking_children < $eb_children_price_start) {
$eb_children_price_total = 0;
} else {
$eb_children_price_total = $eb_children_price * ($eagle_booking_children - $eb_children_price_start);
}
// Calculate the total price
$eb_trip_price = ($eb_trip_price + eb_room_total_price($eb_room_id, $eagle_booking_date_cicle)) + ($eb_adults_price_total) + ($eb_children_price_total);
} else {
$eb_guests_price = get_post_meta($eb_room_id, 'eagle_booking_mtb_room_guests_price', true) ?: 0;
$eb_guests_price_start = get_post_meta($eb_room_id, 'eagle_booking_mtb_room_guests_price_start', true) ?: 0;
// Guests total custom price
if ($eagle_booking_guests < $eb_guests_price_start) {
$eb_guests_price_total = 0;
} else {
$eb_guests_price_total = $eb_guests_price * ($eagle_booking_guests - $eb_guests_price_start);
}
// Calculate the total price
$eb_trip_price = ($eb_trip_price + eb_room_total_price($eb_room_id, $eagle_booking_date_cicle)) + ($eb_guests_price_total);
}
// Charge based on room price x booking nights
} else {
// Calculate the total price
$eb_trip_price = $eb_trip_price + eb_room_total_price($eb_room_id, $eagle_booking_date_cicle);
}
$eagle_booking_date_cicle = date('Y/m/d', strtotime($eagle_booking_date_cicle.' + 1 days'));
$eagle_booking_index++;
endwhile; ?>
<form method="post" action="<?php echo eb_booking_page() ?>">
<input type="hidden" name="eb_room_id" value="<?php echo get_the_ID() ?>">
<input type="hidden" name="eb_checkin" value="<?php echo $eagle_booking_checkin ?>">
<input type="hidden" name="eb_checkout" value="<?php echo $eagle_booking_checkout ?>">
<input type="hidden" name="eb_guests" value="<?php echo $eagle_booking_guests ?>">
<input type="hidden" name="eb_adults" value="<?php echo $eagle_booking_adults ?>">
<input type="hidden" name="eb_children" value="<?php echo $eagle_booking_children ?>">
<button class="eb-proceed-btn eb-btn btn" name="submit" type="submit">
<?php if ( eb_get_option('show_price') == true ) : ?>
<?php if ( eb_get_option('total_price') === 'mouseover' ) : ?>
<span class="eb-btn-text"><?php echo __('Book Now', 'eagle-booking') ?></span>
<span class="total-price-text"><?php echo __('For', 'eagle-booking') ?>
<?php echo eb_price( eb_total_price( get_the_ID(), $eb_trip_price, $eb_booking_nights, $eagle_booking_guests ) ); ?>
</span>
<?php else: ?>
<span><?php echo __('Book For', 'eagle-booking') ?>
<?php echo eb_price( eb_total_price( get_the_ID(), $eb_trip_price, $eb_booking_nights, $eagle_booking_guests ) ) ?>
</span>
<?php endif ?>
<?php else : ?>
<span><?php echo __('Book Now', 'eagle-booking') ?></span>
<?php endif ?>
</button>
<?php if ( eb_room_has_taxes_fees( get_the_ID() ) == true && eb_get_option('show_price') == true ) echo "<small class='eb-price-excludes-tax'><i>".__('Price Excludes Taxes & Fees', 'eagle-booking')."</i></small>"; ?>
</form>
<?php
// Room is not Available - Maximum Booking Nights
} elseif ( $eb_booking_nights > $eb_max_booking_nights ) { ?>
<div class="min-max-booking-nights-notice">
<?php echo __('Max. Booking Nights','eagle-booking') ?>: <?php echo $eb_max_booking_nights ?>
</div>
<?php
// Room is not Available - MInimum Booking Nights
} else { ?>
<div class="min-max-booking-nights-notice">
<?php echo __('Min. Booking Nights','eagle-booking') ?>: <?php echo $eb_min_booking_nights ?>
</div>
<?php } ?>
<?php } else { ?>
<?php if ( empty($eagle_booking_checkin) || empty($eagle_booking_checkout) ) : ?>
<div class="select-booking-dates-notice"><?php echo __('Select Booking Dates','eagle-booking') ?></div>
<?php else: ?>
<div class="not-available-notice"><?php echo __('Those dates are not available','eagle-booking') ?></div>
<?php endif ?>
<?php } ?>
</div>
<?php if ( eb_get_option('eb_search_quick_details') == true ) : ?>
<div class="toggle-room-breakpoint room-more-details">
<?php echo __('Availability & Details', 'eagle-booking') ?> <i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<?php endif ?>
</div>

View File

@@ -0,0 +1,41 @@
<?php
/**
* The Template for displaying quick details
*
* This template can be overridden by copying it to yourtheme/eb-templates/search/quick-details.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.5
*/
defined('ABSPATH') || exit;
?>
<div class="room-quick-details">
<div class="inner">
<?php
$eb_search_filters = eb_get_option('eb_search_quick_details_elements');
if ($eb_search_filters): foreach ($eb_search_filters as $eb_search_filter=>$value) {
switch($eb_search_filter) {
case 'room_availability': include eb_load_template('search/room/quick-details/availability.php');
break;
case 'included_services': include eb_load_template('search/room/quick-details/services.php');
break;
case 'additional_services': include eb_load_template('search/room/quick-details/additional-services.php');
break;
case 'price_breakdown': include eb_load_template('search/room/quick-details/price-breakdown.php');
break;
}
}
endif;
?>
</div>
</div>

View File

@@ -0,0 +1,65 @@
<?php
/**
* The Template for displaying additional services
*
* This template can be overridden by copying it to yourtheme/eb-templates/search/quick-details/additional-services.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.6
*/
defined('ABSPATH') || exit;
?>
<?php
if ( eb_get_option('eb_search_quick_details_elements')['additional_services'] == true ) :
// Get Room Additional Services
$eagle_booking_services_array = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_additional_services', true );
if($eagle_booking_services_array) :
?>
<div class="room-services-list">
<h6 class="section-title"><?php echo esc_html__('Additional Services', 'eagle-booking') ?></h6>
<div class="eb-g-lg-3 eb-g-lg-3 mt30">
<?php
// Start Loop
for ($eagle_booking_services_array_i = 0; $eagle_booking_services_array_i < count($eagle_booking_services_array); $eagle_booking_services_array_i++) {
$eagle_booking_page_by_path = get_post($eagle_booking_services_array[$eagle_booking_services_array_i],OBJECT,'eagle_services');
$eagle_booking_service_id = $eagle_booking_page_by_path->ID;
$eagle_booking_service_name = get_the_title($eagle_booking_service_id);
// Service Icon
$eagle_booking_service_icon_type = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_icon_type', true );
if ($eagle_booking_service_icon_type == 'fontawesome') {
$eagle_booking_service_icon = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_icon_fontawesome', true );
} else {
$eagle_booking_service_icon = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_icon', true );
}
$eagle_booking_mtb_service_image = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_image', true );
$eagle_booking_mtb_service_image_class_original = str_replace(' ', '-', $eagle_booking_service_name);
$eagle_booking_mtb_service_image_class = strtolower($eagle_booking_mtb_service_image_class_original);
$eagle_booking_service_description = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_description', true );
?>
<div class="room-services-item">
<?php if ($eagle_booking_service_icon_type == 'customicon') : ?>
<img src="<?php echo esc_url($eagle_booking_mtb_service_image) ?>" class="<?php echo esc_attr($eagle_booking_mtb_service_image_class) ?>">
<?php else : ?>
<i class="<?php echo $eagle_booking_service_icon ?>"></i>
<?php endif ?>
<?php echo esc_html($eagle_booking_service_name) ?>
</div>
<?php } ?>
</div>
</div>
<?php endif ?>
<?php endif ?>

View File

@@ -0,0 +1,41 @@
<?php
/**
* The Template for displaying availability
*
* This template can be overridden by copying it to yourtheme/eb-templates/search/quick-details/availability.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.5
*/
defined('ABSPATH') || exit;
?>
<?php if ( eb_get_option('eb_search_quick_details_elements')['room_availability'] == true ) : ?>
<?php $eb_end_period = "+".eb_get_option('eb_calendar_availability_period'). " months" ?>
<div id="availability-calendar-<?php echo $eb_room_id ?>"></div>
<ul class="availability-calendar-list-availability">
<li>
<span class="available"></span>
<?php echo __('Available', 'eagle-booking') ?>
</li>
<li>
<span class="not-available"></span>
<?php echo __('Not Available', 'eagle-booking') ?>
</li>
</ul>
<script>
(function($) {
"use strict";
$(document).ready(function() {
$("#availability-calendar-<?php echo $eb_room_id ?>").simpleCalendar({
fixedStartDay: false,
events: <?php echo json_encode( eb_availability_calendar($eb_room_id, date('Y/m/d'), date('Y/m/d', strtotime($eb_end_period)) ), JSON_UNESCAPED_SLASHES ); ?>
});
});
})(jQuery);
</script>
<?php endif ?>

View File

@@ -0,0 +1,72 @@
<?php
/**
* The Template for displaying price breakdown
*
* This template can be overridden by copying it to yourtheme/eb-templates/search/quick-details/price-breakdown.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.7
*/
defined('ABSPATH') || exit;
// Get Room Additional exceptions
$eb_price_exception_array = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_price_exceptions', true );
if ( eb_get_option('eb_search_quick_details_elements')['price_breakdown'] == true && $eb_price_exception_array != '' ) {
?>
<div class="eb-room-price-breakdown">
<h6 class="section-title"><?php echo esc_html__('Price Breakdown', 'eagle-booking') ?></h6>
<?php
// Start Loop
for ($eb_price_exception_array_i = 0; $eb_price_exception_array_i < count($eb_price_exception_array); $eb_price_exception_array_i++) {
$eb_page_by_path = get_post($eb_price_exception_array[$eb_price_exception_array_i],OBJECT,'eagle_exception');
$price_id = $eb_page_by_path->ID;
$eb_exception_title = get_the_title($price_id);
$price_exception_start = get_post_meta( $price_id, 'eagle_booking_mtb_exception_date_from', true );
$price_exception_end = get_post_meta( $price_id, 'eagle_booking_mtb_exception_date_to', true );
$price_exception_price = get_post_meta( $price_id, 'eagle_booking_mtb_exception_price', true );
echo '<div class="room-breakdown-item eg-g-1-1">';
echo '<span>'.$eb_exception_title.'</span>';
echo '<span>'.eagle_booking_displayd_date_format( $price_exception_start ).' &nbsp; → &nbsp; ';
echo eagle_booking_displayd_date_format( $price_exception_end ).'</span>';
if( eb_currency_position() === 'before' ) {
echo '<span class="value">'.eb_currency().''.eb_formatted_price($price_exception_price, false).'</span>';
} else {
echo '<span class="value">'.eb_formatted_price($price_exception_price, false).''.eb_currency().'</span>';
}
echo '</div>';
}
// Get room extra guests option
$eb_room_price_type = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_price_type', true );
if( $eb_room_price_type == 'room_price_nights_guests' || $eb_room_price_type == 'room_price_nights_guests_custom' ) :
?>
<div class="price-breakdown-item mt20">
<i class="fas fa-exclamation-circle"></i> <?php echo __('The displayed price is referred to the room normal price. Pricing based on guests number applied to this room.', 'eagle-booking') ?>
</div>
<?php endif ?>
</div>
<?php
}

View File

@@ -0,0 +1,63 @@
<?php
/**
* The Template for displaying services
*
* This template can be overridden by copying it to yourtheme/eb-templates/search/quick-details/services.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.6
*/
defined('ABSPATH') || exit;
?>
<?php
if ( eb_get_option('eb_search_quick_details_elements')['included_services'] == true ) :
// Get Room Included Services
$eagle_booking_services_array = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_services', true );
if( $eagle_booking_services_array ) :
?>
<div class="room-services-list">
<h6 class="section-title"><?php echo esc_html__('Included Services', 'eagle-booking') ?></h6>
<div class="eb-g-lg-3 eb-g-md-2 mt30">
<?php
// Start Loop
for ($eagle_booking_services_array_i = 0; $eagle_booking_services_array_i < count($eagle_booking_services_array); $eagle_booking_services_array_i++) {
$eagle_booking_page_by_path = get_post($eagle_booking_services_array[$eagle_booking_services_array_i],OBJECT,'eagle_services');
$eagle_booking_service_id = $eagle_booking_page_by_path->ID;
$eagle_booking_service_name = get_the_title($eagle_booking_service_id);
// Service Icon
$eagle_booking_service_icon_type = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_icon_type', true );
if ($eagle_booking_service_icon_type == 'fontawesome') {
$eagle_booking_service_icon = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_icon_fontawesome', true );
} else {
$eagle_booking_service_icon = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_icon', true );
}
$eagle_booking_mtb_service_image = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_image', true );
$eagle_booking_mtb_service_image_class_original = str_replace(' ', '-', $eagle_booking_service_name);
$eagle_booking_mtb_service_image_class = strtolower($eagle_booking_mtb_service_image_class_original);
$eagle_booking_service_description = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_description', true );
?>
<div class="room-services-item">
<?php if ($eagle_booking_service_icon_type == 'customicon') : ?>
<img src="<?php echo esc_url($eagle_booking_mtb_service_image) ?>" class="<?php echo esc_attr($eagle_booking_mtb_service_image_class) ?>">
<?php else : ?>
<i class="<?php echo $eagle_booking_service_icon ?>"></i>
<?php endif ?>
<?php echo esc_html($eagle_booking_service_name) ?>
</div>
<?php } ?>
</div>
</div>
<?php endif ?>
<?php endif ?>

View File

@@ -0,0 +1,60 @@
<?php
/**
* The Template for displaying services
* This template can be overridden by copying it to yourtheme/eb-templates/search/services.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.5
*/
defined('ABSPATH') || exit;
?>
<div class="room-services">
<div class="dragscroll">
<?php
// Get Room Services
$eagle_booking_services_array = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_services', true ) ;
if ( !empty($eagle_booking_services_array) ) :
$eagle_booking_services_counter = count($eagle_booking_services_array);
if ( !empty(get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_services', true ) ) ) :
for ($eagle_booking_services_array_i = 0; $eagle_booking_services_array_i < $eagle_booking_services_counter; $eagle_booking_services_array_i++) {
$eagle_booking_page_by_path = get_post($eagle_booking_services_array[$eagle_booking_services_array_i],OBJECT,'eagle_services');
$eagle_booking_service_id = $eagle_booking_page_by_path->ID;
$eagle_booking_service_name = get_the_title($eagle_booking_service_id);
$eagle_booking_service_icon_type = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_icon_type', true );
// Fontawesome 4 or 5
if ($eagle_booking_service_icon_type == 'fontawesome') {
$eagle_booking_service_icon = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_icon_fontawesome', true );
} else {
$eagle_booking_service_icon = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_icon', true );
}
$eagle_booking_mtb_service_image = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_image', true );
$eagle_booking_mtb_service_image_class_original = str_replace(' ', '-', $eagle_booking_service_name);
$eagle_booking_mtb_service_image_class = strtolower($eagle_booking_mtb_service_image_class_original);
$eagle_booking_service_description = get_post_meta( $eagle_booking_service_id, 'eagle_booking_mtb_service_description', true );
?>
<div class="room-service-item" data-toggle="popover" data-placement="top" data-trigger="hover" data-content="<?php echo $eagle_booking_service_description ?>" data-original-title="<?php echo $eagle_booking_service_name ?>">
<?php if ($eagle_booking_service_icon_type == 'customicon') : ?>
<img src="<?php echo esc_url($eagle_booking_mtb_service_image) ?>" class="<?php echo esc_attr($eagle_booking_mtb_service_image_class) ?>">
<?php else : ?>
<i class="<?php echo $eagle_booking_service_icon ?>"></i>
<?php endif ?>
</div>
<?php } ?>
<?php endif ?>
<?php endif ?>
</div>
</div>

View File

@@ -0,0 +1,49 @@
<?php
/**
* The Template for displaying sorting
*
* This template can be overridden by copying it to yourtheme/eb-templates/search/sorting.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.6
*/
defined('ABSPATH') || exit;
?>
<div class="rooms-bar">
<span class="total-rooms">
<?php echo sprintf( __('You found <strong id="results-number">%s</strong> rooms from', 'eagle-booking'), $eagle_booking_results_qnt ) ?>
<?php echo eb_price( eb_rooms_min_max_price('min') ) ?>
</span>
<span class="rooms-view">
<span class="view-text"><?php echo __('View', 'eagle-booking') ?></span>
<span class="view-btn list-btn <?php echo $eb_rooms_view === "list-view" ? 'active' : '' ?>" data-view="list-view" title="<?php echo __('List View', 'eagle-booking') ?>"><i class="fa fa-list" aria-hidden="true"></i></span>
<span class="view-btn grid-btn <?php echo $eb_rooms_view === "grid-view" ? 'active' : '' ?>" data-view="grid-view" title="<?php echo __('Grid View', 'eagle-booking') ?>"><i class="fa fa-th" aria-hidden="true"></i></span>
</span>
<span class="rooms-view-sorting">
<span class="eb-dropdown eb-rooms-sorting">
<div id="eagle_booking_active_sorting" class="eb-dropdown-toggle"><?php echo __('Sort by: Default','eagle-booking') ?></div>
<ul id="eagle_booking_search_sorting" class="eb-dropdown-menu">
<li class="sorting_option">
<a class="search_sorting" data-meta-key="eagle_booking_mtb_room_price_min" data-order="ASC"><?php echo __('Sort by: Lowest Price','eagle-booking') ?></a>
</li>
<li class="sorting_option">
<a class="search_sorting" data-meta-key="eagle_booking_mtb_room_price_min" data-order="DESC"><?php echo __('Sort by: Highest Price','eagle-booking') ?></a>
</li>
<li class="sorting_option">
<a class="search_sorting" data-meta-key="" data-order=""><?php echo __('Sort by: Default','eagle-booking') ?></a>
</li>
</ul>
</span>
</span>
</div>