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:
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room additional services
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/additional-services.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.5
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
|
||||
$eb_additional_services_array = get_post_meta( $eagle_booking_id, 'eagle_booking_mtb_room_additional_services', true );
|
||||
|
||||
if ( $eb_additional_services_array ) :
|
||||
|
||||
?>
|
||||
|
||||
<div class="room-services-list">
|
||||
<h2 class="section-title"><?php echo esc_html__('Additional Services', 'eagle-booking') ?></h2>
|
||||
<div class="eb-g-lg-3 eb-g-md-2">
|
||||
<?php
|
||||
|
||||
// START LOOP
|
||||
for ($eb_additional_services_array_i = 0; $eb_additional_services_array_i < count($eb_additional_services_array); $eb_additional_services_array_i++) :
|
||||
$eagle_booking_page_by_path = get_post($eb_additional_services_array[$eb_additional_services_array_i],OBJECT,'eagle_services');
|
||||
$eb_additional_service_id = $eagle_booking_page_by_path->ID;
|
||||
$eb_additional_service_name = get_the_title($eb_additional_service_id);
|
||||
|
||||
// FONT ICON & CUSTOM IMAGE
|
||||
$eb_additional_service_icon_type = get_post_meta( $eb_additional_service_id, 'eagle_booking_mtb_service_icon_type', true );
|
||||
if ($eb_additional_service_icon_type == 'fontawesome') {
|
||||
$eb_additional_service_icon = get_post_meta( $eb_additional_service_id, 'eagle_booking_mtb_service_icon_fontawesome', true );
|
||||
} else {
|
||||
$eb_additional_service_icon = get_post_meta( $eb_additional_service_id, 'eagle_booking_mtb_service_icon', true );
|
||||
}
|
||||
|
||||
$eb_mtb_service_image = get_post_meta( $eb_additional_service_id, 'eagle_booking_mtb_service_image', true );
|
||||
$eb_mtb_service_image_class_original = str_replace(' ', '-', $eb_additional_service_name);
|
||||
$eb_mtb_service_image_class = strtolower($eb_mtb_service_image_class_original);
|
||||
// DESCRIPTION
|
||||
$eb_additional_service_description = get_post_meta( $eb_additional_service_id, 'eagle_booking_mtb_service_description', true );
|
||||
?>
|
||||
|
||||
<div class="room-services-item">
|
||||
<?php if ($eb_additional_service_icon_type == 'customicon') : ?>
|
||||
<img src="<?php echo esc_url($eb_mtb_service_image) ?>" class="<?php echo esc_attr($eb_mtb_service_image_class) ?>">
|
||||
<?php else : ?>
|
||||
<i class="<?php echo $eb_additional_service_icon ?>" data-original-title="<?php echo $eb_additional_service_name ?>"></i>
|
||||
<?php endif ?>
|
||||
<?php echo esc_html($eb_additional_service_name) ?>
|
||||
</div>
|
||||
<?php endfor ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room availability
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/availability.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.5
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
?>
|
||||
|
||||
<?php $eb_end_period = "+".eb_get_option('eb_calendar_availability_period'). " months" ?>
|
||||
<h2 class="section-title"><?php echo esc_html__('Room Availability', 'eagle-booking') ?></h2>
|
||||
<div id="availability-calendar"></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>
|
||||
<!-- <li>
|
||||
<span class="semi-available"></span>
|
||||
<?php echo __('Check Out Only', 'eagle-booking') ?>
|
||||
</li> -->
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
(function($) {
|
||||
"use strict";
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#availability-calendar").simpleCalendar({
|
||||
events: eb_booked_dates
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for the calendar
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/booking-form.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.6
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
?>
|
||||
|
||||
<div class="eb-widget eb-widget-border calendar">
|
||||
<h2 class="title"><?php echo __('Book Your Room','eagle-booking') ?></h2>
|
||||
<div class="inner">
|
||||
<form id="room-booking-form" action="<?php echo $eagle_booking_action ?>" class="room-booking-form" method="<?php echo $eagle_booking_action_method ?>" target="<?php echo esc_attr( $eagle_booking_target ) ?>">
|
||||
|
||||
<?php include eb_load_template('elements/custom-parameters.php') ?>
|
||||
|
||||
<input type="hidden" name="eb_room_id" value="<?php echo get_the_ID() ?>" />
|
||||
<input type="hidden" name="eb_single_room" value="1">
|
||||
|
||||
<?php if (eb_get_option('booking_type') == 'custom' ) : ?>
|
||||
<input type="hidden" name="<?php echo esc_html( $eagle_booking_room_param ) ?>" value="<?php echo esc_html( $eagle_booking_room_external_id ) ?>" >
|
||||
<?php endif ?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Include Date Picker
|
||||
*/
|
||||
include eb_load_template('elements/dates-picker.php');
|
||||
|
||||
/**
|
||||
* Include Guests Picker
|
||||
*/
|
||||
include eb_load_template('elements/guests-picker.php');
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
$eb_meta_box_room_custom_link = get_post_meta( get_the_ID(), 'eagle_booking_room_custom_link', true );
|
||||
if ( empty($eb_meta_box_room_custom_link) ) { ?>
|
||||
|
||||
<button id="eb_search_form" name="submit" class="btn eb-btn mt30" type="submit">
|
||||
<span class="eb-btn-text"><?php echo __('Check Availability','eagle-booking') ?></span>
|
||||
</button>
|
||||
|
||||
<?php } else { ?>
|
||||
<a target="_blank" class="btn eb-btn" href="<?php echo $eb_meta_box_room_custom_link ?>"><?php echo __('Book Now','eagle-booking') ?></a>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The Template for the room hotel branch
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/branch.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.0
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( eb_room_has_branch( $eb_room_id ) ) : ?>
|
||||
|
||||
<div class="eb-room-branch eb-widget eb-widget-border">
|
||||
|
||||
<?php
|
||||
echo __('This room is part of', 'eagle-booking').' ';
|
||||
echo eb_room_branch( $eb_room_id, true );
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room content
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/content.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.6
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
?>
|
||||
|
||||
<div class="content">
|
||||
<?php the_content(get_the_ID()) ?>
|
||||
</div>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room slider
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/full-slider.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.6
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
?>
|
||||
|
||||
<div class="room-slider room-full-slider">
|
||||
|
||||
<?php if ($room_slider) : ?>
|
||||
<div id="eb-room-full-slider" class="swiper-container">
|
||||
<div class="swiper-wrapper eb-image-gallery">
|
||||
<?php
|
||||
$files = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_slider_images', true );
|
||||
foreach ( (array) $files as $attachment_id => $attachment_url ) :
|
||||
|
||||
$room_images_url = wp_get_attachment_image_url( $attachment_id, 'full' ); ?>
|
||||
|
||||
<div class="swiper-slide" style="background-image:url(<?php echo esc_url( $room_images_url ) ?>)">
|
||||
<a href="<?php echo esc_url( $room_images_url ) ?>"></a>
|
||||
<img src="<?php echo get_the_post_thumbnail_url('', 'eagle_booking_image_size_1920_800') ?>" alt="<?php echo get_post_meta($attachment_id, '_wp_attachment_image_alt', true) ?>" title="<?php echo get_the_title( $attachment_id ) ?>" height="0" width="0">
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
|
||||
<div class="swiper-pagination"></div>
|
||||
<?php if ( eb_get_option('eb_room_slider_nav') == true ) : ?>
|
||||
<div class="swiper-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>
|
||||
<div class="swiper-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
<?php else : ?>
|
||||
|
||||
<?php if (has_post_thumbnail()) : ?>
|
||||
<div style="background:url('<?php echo get_the_post_thumbnail_url('', 'eagle_booking_image_size_1170_680') ?>'); background-size: cover; min-height: 600px">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room header
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/header.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.6
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$eb_room_header_image = get_post_meta( $eagle_booking_id, 'eagle_booking_mtb_room_header_image', true );
|
||||
|
||||
if( $eb_room_header_image != '' ) {
|
||||
|
||||
$eb_room_header_class = 'image';
|
||||
$eb_room_header_style = 'background:url('.$eb_room_header_image.'); background-size: cover;';
|
||||
|
||||
} else {
|
||||
|
||||
$eb_room_header_class = 'color';
|
||||
$eb_room_header_style = '';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="eb-page-header eb-page-header-<?php echo esc_attr( $eb_room_header_class ) ?> eb-room-header" style="<?php echo esc_attr( $eb_room_header_style ) ?>">
|
||||
<div class="container eb-container">
|
||||
<div class="eb-wrapper">
|
||||
<div class="title">
|
||||
<h1><?php echo $eagle_booking_title ?></h1>
|
||||
<?php if ( eb_get_option('room_breadcrumbs') == true ) : eb_breadcrumb(); endif ?>
|
||||
</div>
|
||||
<?php eb_room_price( get_the_ID(), ' <span>/</span> '.__('per night', 'eagle-booking') ) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room info
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/info.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
?>
|
||||
|
||||
<div class="room-info">
|
||||
|
||||
<?php $eb_room_info_elements = eb_get_option('room_info_elements');
|
||||
|
||||
foreach ($eb_room_info_elements as $eb_room_info_element=>$value) {
|
||||
|
||||
switch ($eb_room_info_element) {
|
||||
|
||||
case 'guests' : if ($value == true) : ?>
|
||||
<div class="item">
|
||||
<i class="flaticon-child"></i>
|
||||
<div class="room-info-content">
|
||||
<?php echo __('Max. Guests', 'eagle-booking') ?>
|
||||
<div>
|
||||
<?php
|
||||
if (eb_get_option('eb_adults_children') == true) {
|
||||
echo esc_html($eb_mtb_room_max_adults).' '.__('Adults', 'eagle-booking').' / ' .esc_html($eb_mtb_room_max_children).' '.__('Children', 'eagle-booking');
|
||||
} else {
|
||||
echo esc_html($eb_mtb_room_max_guests).' '.__('Guests', 'eagle-booking');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; break; ?>
|
||||
|
||||
<?php case 'booking_nights' : if ($value == true) : ?>
|
||||
<div class="item">
|
||||
<i class="flaticon-calendar"></i>
|
||||
<div class="room-info-content">
|
||||
<?php echo __('Booking Nights', 'eagle-booking') ?>
|
||||
<div>
|
||||
<?php echo esc_html( $eb_mtb_room_min_booking_nights ) ?> <?php echo __('Min.', 'eagle-booking') ?>
|
||||
<?php if ( $eb_mtb_room_max_booking_nights != '' ) echo ' / '.esc_html( $eb_mtb_room_max_booking_nights ).' '. __('Max.', 'eagle-booking') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; break; ?>
|
||||
|
||||
<?php case 'bed_type' : if ($value == true) : ?>
|
||||
<div class="item">
|
||||
<i class="flaticon-bed"></i>
|
||||
<div class="room-info-content">
|
||||
<?php echo __('Bed Type', 'eagle-booking')?>
|
||||
<div>
|
||||
<?php echo esc_html( $eb_mtb_room_bed_type ) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; break; ?>
|
||||
|
||||
<?php case 'area' : if ($value == true) : ?>
|
||||
<div class="item">
|
||||
<i class="flaticon-map"></i>
|
||||
<div class="room-info-content">
|
||||
<?php echo __('Area', 'eagle-booking') ?>
|
||||
<div>
|
||||
<?php echo esc_html( $eb_mtb_room_size ) ?> <?php echo eb_get_option('eagle_booking_units_of_measure') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; break ?>
|
||||
|
||||
<?php } } ?>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room reviews
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/reviews.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.6
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$eagle_booking_reviews_array = get_post_meta( $eagle_booking_id, 'eagle_booking_mtb_room_reviews', true );
|
||||
|
||||
if ( !empty($eagle_booking_reviews_array ) ) :
|
||||
?>
|
||||
|
||||
<div class="room-reviews">
|
||||
<h2 class="section-title"><?php echo esc_html__('Room Reviews', 'eagle-booking') ?></h2>
|
||||
|
||||
<?php
|
||||
for ($eagle_booking_reviews_array_i = 0; $eagle_booking_reviews_array_i < count($eagle_booking_reviews_array); $eagle_booking_reviews_array_i++) :
|
||||
|
||||
$eagle_booking_page_by_path = get_post($eagle_booking_reviews_array[$eagle_booking_reviews_array_i], OBJECT,' eagle_reviews');
|
||||
$eagle_booking_review_id = $eagle_booking_page_by_path->ID;
|
||||
$testimonial_title = get_the_title($eagle_booking_review_id);
|
||||
$testimonial_quote = get_post_meta($eagle_booking_review_id, 'eagle_booking_mtb_review_quote', true);
|
||||
$testimonial_name = get_post_meta($eagle_booking_review_id, 'eagle_booking_mtb_review_author', true);
|
||||
$testimonial_location = get_post_meta($eagle_booking_review_id, 'eagle_booking_mtb_review_author_location', true);
|
||||
$testimonial_avatar_file_id = get_post_meta($eagle_booking_review_id, 'eagle_booking_mtb_review_image_id', true );
|
||||
$testimonial_avatar = wp_get_attachment_image_url( $testimonial_avatar_file_id);
|
||||
$testimonial_starnumber = get_post_meta( $eagle_booking_review_id, 'eagle_booking_mtb_review_rating', true );
|
||||
?>
|
||||
<!-- ITEM -->
|
||||
<div class="review-box">
|
||||
<?php if ($testimonial_avatar) : ?>
|
||||
<figure class="review-author">
|
||||
<img src="<?php echo esc_url( $testimonial_avatar ) ?>" alt="<?php echo esc_attr( $testimonial_name ) ?>">
|
||||
</figure>
|
||||
<?php endif ?>
|
||||
<div class="review-content">
|
||||
<div class="rating">
|
||||
<?php
|
||||
for($x=1;$x<=$testimonial_starnumber;$x++) {
|
||||
echo '<i class="fa fa-star" aria-hidden="true"></i>';
|
||||
}
|
||||
if (strpos($testimonial_starnumber,'.')) {
|
||||
echo '<i class="fa fa-star-half-o" aria-hidden="true"></i>';
|
||||
$x++;
|
||||
}
|
||||
while ($x<=5) {
|
||||
echo '<i class="fa fa-star-o" aria-hidden="true"></i>';
|
||||
$x++;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="review-info">
|
||||
<?php echo esc_html( $testimonial_name ) ?> - <?php echo esc_html( $testimonial_location ) ?>
|
||||
</div>
|
||||
<div class="review-text">
|
||||
<p><?php echo esc_html( $testimonial_quote ) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endfor ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
</div>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room services
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/services.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.5
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
|
||||
$eb_services_array = get_post_meta( $eagle_booking_id, 'eagle_booking_mtb_room_services', true );
|
||||
|
||||
if ( $eb_services_array ) :
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<div class="room-services-list">
|
||||
<h2 class="section-title"><?php echo esc_html__('Room Services', 'eagle-booking') ?></h2>
|
||||
<div class="eb-g-lg-3 eb-g-md-2">
|
||||
<?php
|
||||
|
||||
// START LOOP
|
||||
for ($eb_services_array_i = 0; $eb_services_array_i < count($eb_services_array); $eb_services_array_i++) :
|
||||
$eagle_booking_page_by_path = get_post($eb_services_array[$eb_services_array_i],OBJECT,'eagle_services');
|
||||
$eb_service_id = $eagle_booking_page_by_path->ID;
|
||||
$eb_service_name = get_the_title($eb_service_id);
|
||||
|
||||
// FONT ICON & CUSTOM IMAGE
|
||||
$eb_service_icon_type = get_post_meta( $eb_service_id, 'eagle_booking_mtb_service_icon_type', true );
|
||||
if ($eb_service_icon_type == 'fontawesome') {
|
||||
$eb_service_icon = get_post_meta( $eb_service_id, 'eagle_booking_mtb_service_icon_fontawesome', true );
|
||||
} else {
|
||||
$eb_service_icon = get_post_meta( $eb_service_id, 'eagle_booking_mtb_service_icon', true );
|
||||
}
|
||||
|
||||
$eb_mtb_additional_service_image = get_post_meta( $eb_service_id, 'eagle_booking_mtb_service_image', true );
|
||||
$eb_mtb_additional_service_image_class_original = str_replace(' ', '-', $eb_service_name);
|
||||
$eb_mtb_additional_service_image_class = strtolower($eb_mtb_additional_service_image_class_original);
|
||||
// DESCRIPTION
|
||||
$eb_service_description = get_post_meta( $eb_service_id, 'eagle_booking_mtb_service_description', true );
|
||||
?>
|
||||
<div class="room-services-item">
|
||||
<?php if ($eb_service_icon_type == 'customicon') : ?>
|
||||
<img src="<?php echo esc_url($eb_mtb_additional_service_image) ?>" class="<?php echo esc_attr($eb_mtb_additional_service_image_class) ?>">
|
||||
<?php else : ?>
|
||||
<i class="<?php echo $eb_service_icon ?>" data-original-title="<?php echo $eb_service_name ?>"></i>
|
||||
<?php endif ?>
|
||||
<?php echo esc_html($eb_service_name) ?>
|
||||
</div>
|
||||
<?php endfor ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room sidebar
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/sidebar.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.5
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
?>
|
||||
|
||||
<div class="eb-column">
|
||||
<div class="room-sidebar <?php if (eb_get_option('eb_room_page_sticky_sidebar') == true ) echo esc_attr('sticky-sidebar'); ?>">
|
||||
|
||||
<?php
|
||||
|
||||
// Load hotel branch if enabled
|
||||
if ( eb_get_option('room_hotel_branch') == true ) include eb_load_template('single-room/branch.php');
|
||||
|
||||
// Load booking form if enabled
|
||||
if (eb_get_option('eagle_booking_room_booking_form') == true ) include eb_load_template('single-room/booking-form.php');
|
||||
|
||||
// Get sidebar widgets
|
||||
dynamic_sidebar("eagle_booking_single_room_sidebar");
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room similar rooms
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/similar-rooms.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.6
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
|
||||
$branch_terms = get_the_terms( get_the_ID(), 'eagle_branch' );
|
||||
$branch_id = join(', ', wp_list_pluck($branch_terms, 'term_id'));
|
||||
|
||||
// If a branch is assigend then display only rooms of the same branch
|
||||
if ( $branch_id ) {
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'eagle_rooms',
|
||||
'post__not_in' => array( get_the_ID() ),
|
||||
'posts_per_page' => 3,
|
||||
'orderby' => 'rand',
|
||||
'suppress_filters' => false,
|
||||
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'eagle_branch',
|
||||
'field' => 'term_id',
|
||||
'terms' => $branch_id
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'eagle_rooms',
|
||||
'post__not_in' => array( get_the_ID() ),
|
||||
'posts_per_page' => 3,
|
||||
'suppress_filters' => false
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
$similar_rooms_qry = new WP_Query($args);
|
||||
|
||||
?>
|
||||
|
||||
<div class="similar-rooms">
|
||||
<h2 class="section-title"><?php echo esc_html__('Similar Rooms', 'eagle-booking')?></h2>
|
||||
<div class="eb-g-lg-3 eb-g-sm-1">
|
||||
<?php
|
||||
if ( $similar_rooms_qry->have_posts() ) : while ($similar_rooms_qry->have_posts()) : $similar_rooms_qry->the_post();
|
||||
$eagle_booking_room_id = get_the_id();
|
||||
$room_title = get_the_title();
|
||||
$room_thumbnail = get_the_post_thumbnail_url('', 'eagle_booking_image_size_720_470');
|
||||
$room_url = get_permalink();
|
||||
$eagle_booking_room_price = eagle_booking_room_min_price($eagle_booking_room_id);
|
||||
?>
|
||||
<div class="eb-col">
|
||||
<div class="similar-room-item" style="background-image: url('<?php echo $room_thumbnail ?>');">
|
||||
<a href="<?php echo esc_url( $room_url ) ?>">
|
||||
<div class="room-details">
|
||||
<h4 class="room-title"><?php echo esc_html( $room_title ) ?> </h4>
|
||||
<?php eb_room_price( get_the_ID(), ' / '.__('night', 'eagle-booking') ) ?>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endwhile; endif; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying all single rooms
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/single-room.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.9
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
get_header();
|
||||
|
||||
if ( have_posts() ) : the_post();
|
||||
|
||||
// Include form parameters
|
||||
include_once EB_PATH . '/core/admin/form-parameters.php';
|
||||
|
||||
// Dates
|
||||
$eagle_booking_checkin = date('m/d/Y');
|
||||
$eagle_booking_checkout = date('m/d/Y', strtotime(' + 1 days'));
|
||||
$eagle_booking_guests_default = eb_get_option( 'eagle_booking_default_guests' );
|
||||
$eagle_booking_nights_default = 0;
|
||||
|
||||
// Defaults
|
||||
$eagle_booking_id = get_the_ID();
|
||||
$eagle_booking_title = get_the_title();
|
||||
|
||||
/**
|
||||
* Room ID based on used multi-language plugin (WPML or Polylang)
|
||||
*/
|
||||
if ( function_exists('wpml_loaded') ) {
|
||||
|
||||
$eb_room_id = apply_filters('wpml_object_id', get_the_ID(), 'eagle_rooms', true, apply_filters('wpml_default_language', NULL ));
|
||||
|
||||
} elseif ( function_exists('pll_the_languages') ) {
|
||||
|
||||
$eb_room_id = pll_get_post( get_the_ID(), pll_default_language() );
|
||||
|
||||
} else {
|
||||
|
||||
$eb_room_id = $eb_room_id ;
|
||||
|
||||
}
|
||||
|
||||
// Get external integration
|
||||
$eagle_booking_room_param = eb_get_option('booking_type_custom_room_param');
|
||||
$eagle_booking_room_external_url = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_integration_link', true );
|
||||
$eagle_booking_room_external_id = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_integration_id', true );
|
||||
|
||||
// Overide the form action if room external link has been set
|
||||
if ( !empty($eagle_booking_room_external_url) ) $eagle_booking_action = $eagle_booking_room_external_url;
|
||||
|
||||
// MTB
|
||||
$eagle_booking_mtb_room_file_id = get_post_meta( $eagle_booking_id, 'eagle_booking_mtb_room_header_id', true );
|
||||
$eb_room_page_layout = get_post_meta( $eagle_booking_id, 'eagle_booking_mtb_room_page_layout', true );
|
||||
if ( $eb_room_page_layout == '' ) $eb_room_page_layout = 'normal-slider';
|
||||
$eb_room_header_bg = wp_get_attachment_image_url( $eagle_booking_mtb_room_file_id, 'full' );
|
||||
$eb_mtb_room_max_guests = get_post_meta(get_the_ID(), 'eagle_booking_mtb_room_maxguests', true);
|
||||
$eb_mtb_room_max_adults = get_post_meta(get_the_ID(), 'eagle_booking_mtb_room_max_adults', true);
|
||||
$eb_mtb_room_max_children = get_post_meta(get_the_ID(), 'eagle_booking_mtb_room_max_children', true);
|
||||
|
||||
$eb_mtb_room_min_booking_nights = get_post_meta(get_the_ID(), 'eagle_booking_mtb_room_min_booking_nights', true);
|
||||
$eb_mtb_room_max_booking_nights = get_post_meta(get_the_ID(), 'eagle_booking_mtb_room_max_booking_nights', true);
|
||||
|
||||
if( empty( $eb_mtb_room_min_booking_nights ) ) $eb_mtb_room_min_booking_nights = 1;
|
||||
|
||||
$eb_mtb_room_size = get_post_meta(get_the_ID(), 'eagle_booking_mtb_room_size', true);
|
||||
$eb_mtb_room_bed_type = get_post_meta(get_the_ID(), 'eagle_booking_mtb_room_bed_type', true);
|
||||
|
||||
$eb_room_sidebar = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_sidebar', true);
|
||||
|
||||
// Room Grid
|
||||
if ( $eb_room_sidebar == 'none' ) {
|
||||
|
||||
$eb_room_grid_class = 'eb-no-sidebar';
|
||||
|
||||
} elseif ( $eb_room_sidebar === 'left' ) {
|
||||
|
||||
$eb_room_grid_class = 'eb-sidebar eb-left-sidebar';
|
||||
|
||||
} else {
|
||||
|
||||
$eb_room_grid_class = 'eb-sidebar eb-right-sidebar';
|
||||
|
||||
}
|
||||
|
||||
$room_slider = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_slider_images', true);
|
||||
$eagle_booking_meta_box_min_price = get_post_meta( $eagle_booking_id, 'eagle_booking_mtb_room_price_min', true );
|
||||
if (empty(get_post_meta( $eagle_booking_id, 'eagle_booking_mtb_room_maxguests', true ) ) ) {
|
||||
$eagle_booking_meta_box_max_people = 4;
|
||||
} else {
|
||||
$eagle_booking_meta_box_max_people = get_post_meta( $eagle_booking_id, 'eagle_booking_mtb_room_maxguests', true );
|
||||
}
|
||||
$eagle_booking_meta_box_text_preview = get_post_meta( $eagle_booking_id, 'eagle_booking_mtb_room_description', true );
|
||||
|
||||
/**
|
||||
* Include Room Header
|
||||
*/
|
||||
if ( $eb_room_page_layout == 'normal-slider') include eb_load_template('single-room/header.php');
|
||||
|
||||
/**
|
||||
* Include Room Full-Width Slider
|
||||
*/
|
||||
if ( $eb_room_page_layout == 'full-slider') include eb_load_template('single-room/full-slider.php');
|
||||
|
||||
?>
|
||||
|
||||
<main id="eb-room-<?php echo esc_attr($eagle_booking_id) ?>" class="room-page eb-room-page">
|
||||
<div class="container eb-container">
|
||||
<div class="<?php echo esc_attr( 'eb-room-page'.' '.$eb_room_grid_class ) ?> eb-sticky-sidebar-container">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Include Room Sidebar
|
||||
*/
|
||||
if ( $eb_room_sidebar == 'left' ) include eb_load_template('single-room/sidebar.php');
|
||||
?>
|
||||
|
||||
<div class="eb-column">
|
||||
|
||||
<?php if ( $eb_room_page_layout == 'full-slider') : ?>
|
||||
<div class="eb-g-5-3 room-main-details">
|
||||
<div class="eb-col">
|
||||
<div class="room-title">
|
||||
<h1><?php echo $eagle_booking_title ?></h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eb-col">
|
||||
<?php eb_room_price( get_the_ID(), ' / '.__('per night', 'eagle-booking') ) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Include Room Normal Slider
|
||||
*/
|
||||
if ( $eb_room_page_layout == 'normal-slider') include eb_load_template('single-room/slider.php');
|
||||
|
||||
/**
|
||||
* Sortable Room Elements
|
||||
*/
|
||||
$eb_room_elements = eb_get_option('eagle_booking_room_page_settings');
|
||||
if ($eb_room_elements) {
|
||||
foreach ($eb_room_elements as $eb_room_element=>$value) {
|
||||
switch($eb_room_element) {
|
||||
case 'basic_info': if ( $value == true ) include eb_load_template('single-room/info.php');
|
||||
break;
|
||||
case 'room_content': if ( $value == true ) include eb_load_template('single-room/content.php');
|
||||
break;
|
||||
case 'room_availability': if ( $value == true ) include eb_load_template('single-room/availability.php');
|
||||
break;
|
||||
case 'room_services': if ( $value == true ) include eb_load_template('single-room/services.php');
|
||||
break;
|
||||
case 'room_additional_services': if ( $value == true ) include eb_load_template('single-room/additional-services.php');
|
||||
break;
|
||||
case 'room_reviews': if ( $value == true ) include eb_load_template('single-room/reviews.php');
|
||||
break;
|
||||
case 'similar_rooms': if ( $value == true ) include eb_load_template('single-room/similar-rooms.php');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Include Room Sidebar
|
||||
*/
|
||||
if ( $eb_room_sidebar == 'right' ) include eb_load_template('single-room/sidebar.php');
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script type="text/javascript">
|
||||
var eb_booked_dates = <?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 ); ?>;
|
||||
</script>
|
||||
|
||||
<?php endif ?>
|
||||
<?php get_footer(); ?>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying room slider
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/single-room/slider.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.6
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($room_slider) : ?>
|
||||
|
||||
<div class="room-slider">
|
||||
|
||||
<div id="eb-room-slider" class="swiper-container">
|
||||
<div class="swiper-wrapper eb-image-gallery">
|
||||
<?php
|
||||
$files = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_slider_images', true );
|
||||
foreach ( (array) $files as $attachment_id => $attachment_url ) :
|
||||
|
||||
$room_images_url = wp_get_attachment_image_url( $attachment_id, 'full' ); ?>
|
||||
|
||||
<div class="swiper-slide" style="background-image:url(<?php echo esc_url( $room_images_url ) ?>)">
|
||||
<a href="<?php echo esc_url( $room_images_url ) ?>"></a>
|
||||
<img src="<?php echo get_the_post_thumbnail_url('', 'eagle_booking_image_size_1170_680') ?>" alt="<?php echo get_post_meta($attachment_id, '_wp_attachment_image_alt', true) ?>" title="<?php echo get_the_title( $attachment_id ) ?>" height="0" width="0">
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?php if ( eb_get_option('eb_room_slider_nav') == true ) : ?>
|
||||
<div class="swiper-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>
|
||||
<div class="swiper-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="room-slider-thumbs">
|
||||
<div id="eb-room-slider-thumbs" class="swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
$files = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_slider_images', true );
|
||||
foreach ( (array) $files as $attachment_id => $attachment_url ) :
|
||||
$room_images_url = wp_get_attachment_image_url( $attachment_id, 'eagle_booking_image_size_1170_680' ); ?>
|
||||
<div class="swiper-slide" style="background-image:url(<?php echo esc_url( $room_images_url ) ?>)"></div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<?php if (has_post_thumbnail()) : ?>
|
||||
<figure>
|
||||
<img src="<?php echo get_the_post_thumbnail_url('', 'eagle_booking_image_size_1170_680') ?>" class="img-responsive" alt="<?php echo the_title() ?>">
|
||||
</figure>
|
||||
<?php endif ?>
|
||||
|
||||
<?php endif ?>
|
||||
Reference in New Issue
Block a user