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,185 @@
<?php
/**
* The Template for the additional services
*
* This template can be overridden by copying it to yourtheme/eb-templates/booking/additional-services.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.7
*/
defined('ABSPATH') || exit;
$eb_room_additional_services = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_additional_services', true );
if ( $eb_room_additional_services ) : ?>
<div class="eb-section eb-checkout-form">
<h2 class="title"><?php echo __('Additional Services','eagle-booking') ?></h2>
<div class="inner">
<?php
$eb_room_additional_services = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_additional_services', true );
for ( $eb_i = 0; $eb_i < count($eb_room_additional_services); $eb_i++) :
// Get service mtb
$eb_room_additional_service = get_post($eb_room_additional_services[$eb_i],OBJECT,'eagle_services');
$eb_additional_service_id = $eb_room_additional_service->ID;
$eb_additional_service_name = get_the_title($eb_additional_service_id);
$eb_service_price = get_post_meta( $eb_additional_service_id, 'eagle_booking_mtb_service_price', true );
$eb_additional_service_description = get_post_meta( $eb_additional_service_id, 'eagle_booking_mtb_service_description', true );
// Get service type
$eb_additional_service_price_type = get_post_meta( $eb_additional_service_id, 'eagle_booking_mtb_service_price_type', true );
// Get service type 2
$eb_additional_service_price_type_2 = get_post_meta( $eb_additional_service_id, 'eagle_booking_mtb_service_price_type_2', true );
// Check service price type
if ( $eb_additional_service_price_type == 'guest' ) {
$eb_additional_service_price_operator = $eb_guests;
$eb_additional_service_price_word = __('Guest','eagle-booking');
} elseif ($eb_additional_service_price_type == 'adult') {
$eb_additional_service_price_operator = $eb_adults ;
$eb_additional_service_price_word = __('Adult','eagle-booking');
} elseif ($eb_additional_service_price_type == 'children') {
$eb_additional_service_price_operator = $eb_children ;
$eb_additional_service_price_word = __('Children','eagle-booking');
} elseif ($eb_additional_service_price_type == 'adult_children') {
$eb_additional_service_price_operator = $eb_adults + $eb_children;
$eb_additional_service_price_word = __('Adults + Children','eagle-booking');
} else {
$eb_additional_service_price_operator = 1;
$eb_additional_service_price_word = __('Room','eagle-booking');
}
// Check service price type 2
if ( $eb_additional_service_price_type_2 == 'night' ) {
$eb_additional_service_price_operator_2 = eb_total_booking_nights($eb_checkin, $eb_checkout);
$eb_additional_service_price_word_2 = __('Night','eagle-booking');
} else {
$eb_additional_service_price_operator_2 = 1;
$eb_additional_service_price_word_2 = __('Trip','eagle-booking');
}
/**
* Calculate Additional Services Price
*/
$eb_service_price_before_tax = $eb_service_price * $eb_additional_service_price_operator * $eb_additional_service_price_operator_2;
/**
* Add Taxes to Additional Services
*/
$eb_taxes = get_option('eb_taxes');
$eb_room_taxes = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_taxes', true );
if ( empty( $eb_room_taxes ) ) $eb_room_taxes = array();
$entry_id = '';
if ( $eb_taxes ) {
$eb_tax_percentage = 0;
$out = array();
foreach( $eb_taxes as $key => $item ) {
$entry_id = !empty( $item["id"] ) ? $item["id"] : '';
$global = !empty( $item["global"] ) ? $item["global"] : '';
$services = !empty( $item["services"] ) ? $item["services"] : '';
$amount = !empty( $item["amount"] ) ? $item["amount"] : '';
// Lets check if the tax is global or if is asigned to the room and if tax is aplied on services
if ( ( $global == true || in_array( $entry_id, $eb_room_taxes) ) && $services == true ) {
$eb_tax_percentage += $amount;
array_push($out, $entry_id);
}
}
// Add the tax price to the service price
$eb_service_price = $eb_service_price + $eb_tax_percentage * $eb_service_price / 100;
$eb_service_total_price = $eb_service_price_before_tax + ( $eb_service_price_before_tax * $eb_tax_percentage / 100 );
$eb_applied_taxes = implode(', ', $out);
} else {
$eb_service_price = $eb_service_price;
$eb_service_total_price = $eb_service_price_before_tax;
$eb_applied_taxes = '';
}
/**
* Additional Services Display
*/
if ( eb_get_option('price_taxes') === 'excluding' ){
$eb_service_total_price = $eb_service_price_before_tax;
} else {
$eb_service_total_price = $eb_service_total_price;
}
/**
* Services Price
*/
if ( $eb_service_total_price == 0 ) {
$eb_service_displayed_total_price = __('Free', 'eagle-booking');
} else if ( eb_currency_position() == 'before' ) {
$eb_service_displayed_price = eb_currency().''.eb_formatted_price( $eb_service_price, false );
$eb_service_displayed_total_price = eb_currency().''.eb_formatted_price( $eb_service_total_price, false );
} else {
$eb_service_displayed_price = eb_formatted_price( $eb_service_price, false ).''.eb_currency();
$eb_service_displayed_total_price = eb_formatted_price( $eb_service_total_price, false ).''.eb_currency();
}
?>
<div class="additional-service-item" data-service-id="<?php echo $eb_additional_service_id ?>">
<input type="checkbox" data-id="<?php echo $eb_additional_service_id ?>" data-amount="<?php echo $eb_service_price_before_tax ?>" data-aplied-taxes="<?php echo $eb_applied_taxes?>" value="<?php echo $eb_service_price_before_tax ?>" >
<div class="additional-service-details">
<span class="eb-booking-service-title"><strong><?php echo $eb_additional_service_name ?></strong></span>
<?php if ( eb_get_option( 'show_price' ) == true ) : ?>
<span><?php if ( $eb_service_total_price != 0 ) : ?><?php echo $eb_service_displayed_price ?> (<?php echo $eb_additional_service_price_word ?> / <?php echo $eb_additional_service_price_word_2 ?>)<?php endif ?></span>
<span class="eb-booking-service-price"><strong><?php echo $eb_service_displayed_total_price ?></strong></span>
<?php endif ?>
</div>
<?php if( $eb_additional_service_description ) : ?> <span class="toggle-service-full-details"> <i class="far fa-question-circle"></i> </span> <?php endif ?>
<?php if( $eb_additional_service_description ) : ?> <div class="additional-service-full-details"> <?php echo $eb_additional_service_description ?> </div><?php endif ?>
</div>
<?php endfor ?>
<input type="hidden" id="eb_services_amount" value="0">
</div>
</div>
<?php endif ?>

View File

@@ -0,0 +1,117 @@
<?php
/**
* The Template for the booking details
*
* This template can be overridden by copying it to yourtheme/eb-templates/booking/details.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.7
*/
defined('ABSPATH') || exit;
?>
<div class="booking-sidebar <?php if ( eb_get_option('eb_booking_page_sticky_sidebar') == true ) echo 'sticky-sidebar'; ?>">
<div class="eb-widget no-title">
<div class="inner">
<!-- Selected Room -->
<?php
$eagle_booking_selected_room_image = eagle_booking_get_room_img_url($eb_room_id, 'eagle_booking_image_size_720_470');
$eagle_booking_selected_room_url = get_permalink( $eb_room_id );
if ( !empty($eagle_booking_selected_room_image) ) : ?>
<div class="selected-room">
<a href="<?php echo esc_url($eagle_booking_selected_room_url) ?>" target="_blank">
<img src="<?php echo $eagle_booking_selected_room_image ?>" class="img-responsive">
</a>
</div>
<?php endif ?>
<div class="booking-info">
<!-- Booking Details -->
<div class="booking-details">
<div class="title"> <?php echo __('Booking Details', 'eagle-booking') ?> </div>
<?php if ( eb_room_has_branch( $eb_room_id ) ) : ?>
<div class="item branch">
<span class="desc"><?php echo esc_html__('Branch', 'eagle-booking') ?></span>
<span class="value"><strong><?php echo eb_room_branch( $eb_room_id, true, true ) ?></strong></span>
</div>
<?php endif ?>
<div class="item checkin">
<span class="desc"><?php echo esc_html__('Check In', 'eagle-booking') ?></span>
<span class="value"><strong><?php echo eagle_booking_displayd_date_format($eb_checkin); ?></strong><?php eb_checkin_checkout_time('checkin') ?></span>
</div>
<div class="item checkout">
<span class="desc"> <?php echo esc_html__('Check Out', 'eagle-booking') ?></span>
<span class="value"><strong><?php echo eagle_booking_displayd_date_format($eb_checkout); ?></strong><?php eb_checkin_checkout_time('checkout') ?></span>
</div>
<div class="item booking-nights">
<span class="desc"><?php echo esc_html__('Nights', 'eagle-booking') ?></span>
<span class="value"><strong><?php echo eb_total_booking_nights($eb_checkin, $eb_checkout) ?></strong></span>
</div>
<div class="item guests">
<span class="desc"><?php echo esc_html__('Guests', 'eagle-booking') ?></span>
<span class="value">
<strong>
<?php if ( eb_get_option('eb_adults_children') == true ) : ?>
<?php echo $eb_adults.' '. esc_html__('Adults', 'eagle-booking'). ', ' .$eb_children.' '.esc_html__('Children', 'eagle-booking') ?>
<?php else : ?>
<?php echo $eb_guests ?>
<?php endif ?>
</strong>
</span>
</div>
<div id="eb_services_info" class="title" style="display: none"> <?php echo __('Additional Services', 'eagle-booking') ?> </div>
<?php if ( eb_get_option('show_price') == true ) : ?>
<div class="eb-price-summary">
<div class="title"><?php echo __('Price Summary', 'eagle-booking') ?></div>
<div class="item room">
<span class="desc"><a href="<?php echo esc_url($eagle_booking_selected_room_url) ?>" target="_blank"><?php echo get_the_title($eb_room_id) ?></a></span>
<span class="value">
<strong>
<?php if ( eb_currency_position() == 'before' ) : ?>
<?php echo eb_currency() ?><?php eb_formatted_price($eb_room_total_price) ?>
<?php else : ?>
<?php eb_formatted_price($eb_room_total_price) ?><?php echo eb_currency() ?>
<?php endif ?>
</strong>
</span>
</div>
<?php include eb_load_template('booking/taxesfees.php'); ?>
</div>
<?php endif ?>
<?php if ( eb_get_option('show_price') == true ) : ?>
<div id="eb_total_price_text" class="item total-price">
<span class="desc"><strong><?php echo esc_html__('Total Price', 'eagle-booking') ?></strong></span>
<span class="value">
<strong><?php echo eb_price( eb_total_price($eb_room_id, $eb_room_total_price, $eb_booking_nights, $eb_guests, true) ); ?></strong>
</span>
</div>
<?php endif ?>
</div>
<button id="submit_booking_form" class="btn eb-btn mt10" type="submit">
<span class="eb-btn-text"><?php echo __('Proceed to Checkout','eagle-booking') ?></span>
</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,169 @@
<?php
/**
* The Template for the booking form
*
* This template can be overridden by copying it to yourtheme/eb-templates/booking/form.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1.5
*/
defined('ABSPATH') || exit;
?>
<div class="eb-section eb-checkout-form">
<h2 class="title"><?php echo __('Billing Details','eagle-booking') ?></h2>
<?php
$eb_current_user_id = get_current_user_id();
$eb_current_user = wp_get_current_user();
$eb_booking_forms = eb_get_option('checkout_form');
// check if signin & signup option is enabled
if ( $eb_booking_forms['signin'] == true || $eb_booking_forms['signup'] == true || $eb_booking_forms['guest'] == true ) {
include eb_load_template('booking/form/signedin.php');
?>
<div id="eb_billing_tabs" class="eb-tabs" style="<?php if (is_user_logged_in()) { echo esc_attr('display: none;'); } ?>">
<div class="eb-tabs-titles">
<?php
foreach ($eb_booking_forms as $eb_booking_form => $value) :
switch ($eb_booking_form) :
case 'signin': if ($value == 1) : ?>
<div class="eb-tab" data-tab="signin">
<input class="tab-radio" id="eb_signin" name="eb_billing_tab" type="radio" value="signin">
<label for="eb_signin" class="radio-label"><?php echo __('Existing Customer Login', 'eagle-booking') ?></label>
</div>
<?php endif;
break; ?>
<?php case 'signup': if ($value == 1) : ?>
<div class="eb-tab" data-tab="signup">
<input class="tab-radio" id="eb_signup" name="eb_billing_tab" type="radio" value="signup">
<label for="eb_signup" class="radio-label"><?php echo __('Create a New Account', 'eagle-booking') ?></label>
</div>
<?php endif;
break; ?>
<?php case 'guest': if ($value == 1) : ?>
<div class="eb-tab" data-tab="guest">
<input class="tab-radio" id="eb_guest" name="eb_billing_tab" type="radio" value="guest">
<label for="eb_guest" class="radio-label"><?php echo __('Checkout as Guest', 'eagle-booking') ?></label>
</div>
<?php endif;
break;
endswitch;
endforeach; ?>
</div>
<div id="eb_billing_tabs_content" class="eb-tabs-content">
<?php
foreach ($eb_booking_forms as $eb_booking_form => $value) {
switch ($eb_booking_form) {
case 'signin': if ($value == 1) {
include eb_load_template('booking/form/signin.php');
}
break;
case 'signup': if ($value == 1) {
include eb_load_template('booking/form/signup.php');
}
break;
case 'guest': if ($value == 1) {
include eb_load_template('booking/form/guest.php');
}
break;
}
}
?>
</div>
</div>
<?php
} else {
echo '<div id="eb_billing_tabs_content" class="eb-tabs-content">';
include eb_load_template('booking/form/guest.php');
echo '</div>';
}
?>
<form id="eb_booking_form" method="post" class="eagle-booking-booking-form" action="<?php echo eb_checkout_page() ?>">
<input type="hidden" id="eb_security" value="<?php echo wp_create_nonce('eb_nonce', 'security'); ?>">
<input type="hidden" id="eb_arrive" name="eb_arrive" value="1">
<input type="hidden" id="eb_booking_price" name="eb_booking_price" data-initial-amount="<?php echo eb_total_price($eb_room_id, $eb_trip_price, $eb_booking_nights, $eb_guests, true); ?>" value="<?php echo eb_total_price($eb_room_id, $eb_trip_price, $eb_booking_nights, $eb_guests, true); ?>">
<input type="hidden" id="eb_room_price" name="eb_room_price" value="<?php echo $eb_room_total_price ?>">
<input type="hidden" id="eb_services_taxes">
<input type="hidden" id="eb_date_from" name="eb_date_from" value="<?php echo $eb_checkin ?>">
<input type="hidden" id="eb_date_to" name="eb_date_to" value="<?php echo $eb_checkout ?>">
<input type="hidden" id="eb_guests" name="eb_guests" value="<?php echo $eb_guests ?>">
<input type="hidden" id="eb_adults" name="eb_adults" value="<?php echo $eb_adults ?>">
<input type="hidden" id="eb_children" name="eb_children" value="<?php echo $eb_children ?>">
<input type="hidden" id="eb_id" name="eb_room_id" value="<?php echo $eb_room_id ?>">
<input type="hidden" id="eb_title" name="eb_room_title" value="<?php echo get_the_title($eb_room_id) ?>">
<input type="hidden" id="eb_additional_services_id" name="eb_additional_services_id">
<input type="hidden" id="eb_user_first_name" name="eb_user_firstname">
<input type="hidden" id="eb_user_last_name" name="eb_user_lastname">
<input type="hidden" id="eb_user_email" name="eb_user_email">
<input type="hidden" id="eb_user_phone" name="eb_user_phone">
<input type="hidden" id="eb_user_country" name="eb_user_country">
<input type="hidden" id="eb_user_city" name="eb_user_city">
<input type="hidden" id="eb_user_address" name="eb_user_address">
<input type="hidden" id="eb_user_zip" name="eb_user_zip">
<?php
/**
* Include booking details
*/
if ( eb_get_option('eb_booking_form_fields')['requests'] == true ) include eb_load_template('booking/form/details.php');
/**
* Include arrival time
*/
if ( eb_get_option('eb_booking_form_fields')['arrival'] == true && eb_get_option('arrival_slots') != '' ) include eb_load_template('booking/form/arrival.php');
/**
* Include coupon code
*/
if ( eb_get_option('eb_booking_form_fields')['coupon'] == true ) include eb_load_template('booking/form/coupon.php');
/**
* Include terms & condition checkbox
*/
if ( eb_get_option('eb_booking_form_fields')['terms_conditions'] == true ) include eb_load_template('booking/form/terms.php');
/**
* Include phone field translation
*/
include eb_load_template('elements/phone-field.php');
?>
</form>
</div>

View File

@@ -0,0 +1,22 @@
<div class="form-panel">
<h2 class="title"><?php echo __('Arrival Time','eagle-booking') ?></h2>
<div class="eb-arrival-slots">
<?php
$eb_arrival_slots = eb_get_option('arrival_slots');
if ( $eb_arrival_slots ) foreach ( $eb_arrival_slots as $eb_arrival_slot ) {
echo '<div class="time-slot eb-radio-box">';
echo '<input type="radio" name="eb_user_arrival" id="'.str_replace(" ","",$eb_arrival_slot).'" value="'.$eb_arrival_slot.'">';
echo '<label for="'.str_replace(" ","",$eb_arrival_slot).'" >' . $eb_arrival_slot . '</label>';
echo '</div>';
}
?>
</div>
</div>

View File

@@ -0,0 +1,36 @@
<?php
/**
* The Template for the coupon code
*
* This template can be overridden by copying it to yourtheme/eb-templates/booking/form/coupon.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1
*/
defined('ABSPATH') || exit;
?>
<div class="form-panel">
<h2 class="title"><?php echo __('Coupon','eagle-booking') ?></h2>
<div id="eb_coupon_code_response" class="eb-alert eb-alert-small eb-alert-icon" style="display: none" role="alert">
<span id="eb_coupon_code_response_text"></span>
</div>
<div id="eb_coupon_code_group" class="eb-g-5-2">
<div>
<input name="eb_coupon" type="text" id="eb_coupon" class="eb-field eb-coupon" style="margin-bottom: 0;" placeholder="<?php echo __('Enter coupon code if you have one', 'eagle-booking') ?>">
<input type="hidden" id="eb_coupon_code" name="eb_coupon_code">
<input type="hidden" id="eb_coupon_value">
</div>
<div>
<button id="eb_validate_coupon" class="btn eb-btn btn-full btn-coupon">
<span class="eb-btn-text"><?php echo __('Validate Code', 'eagle-booking') ?></span>
</button>
</div>
</div>
</div>

View File

@@ -0,0 +1,6 @@
<div class="form-panel">
<h2 class="title"><?php echo __('Special Requests','eagle-booking') ?></h2>
<textarea name="eb_user_requests" id="eagle_booking_requests" class="eb-field" rows="6" placeholder="<?php echo __('Let us know if you have any special requests.', 'eagle-booking') ?>"></textarea>
</div>

View File

@@ -0,0 +1,64 @@
<?php
/**
* The Template for the guest form
*
* This template can be overridden by copying it to yourtheme/eb-templates/booking/form/coupon.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.0
*/
defined('ABSPATH') || exit;
?>
<div class="eb-tab-content guest" data-tab="guest">
<div class="eb-g-lg-2 eb-g-md-1">
<div class="eb-form-col">
<input type="text" id="eb_guest_first_name" class="eb-field">
<label><?php echo __('First Name','eagle-booking') ?></label>
</div>
<div class="eb-form-col">
<input type="text" id="eb_guest_last_name" class="eb-field">
<label><?php echo __('Last Name','eagle-booking') ?></label>
</div>
<div class="eb-form-col">
<input type="email" id="eb_guest_email" class="eb-field">
<label><?php echo __('Email','eagle-booking') ?></label>
</div>
<input type="tel" id="eb_guest_phone" class="eb_user_phone_field eb-field" placeholder="<?php echo __('Phone','eagle-booking') ?> *">
<?php if ( eb_get_option('eb_booking_form_fields')['address'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_guest_address" class="eb-field">
<label><?php echo __('Address','eagle-booking') ?></label>
</div>
<?php endif ?>
<?php if ( eb_get_option('eb_booking_form_fields')['city'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_guest_city" class="eb-field">
<label><?php echo __('City','eagle-booking') ?></label>
</div>
<?php endif ?>
<?php if ( eb_get_option('eb_booking_form_fields')['country'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_guest_country" class="eb-field">
<label><?php echo __('Country','eagle-booking') ?></label>
</div>
<?php endif ?>
<?php if ( eb_get_option('eb_booking_form_fields')['zip'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_guest_zip" class="eb-field">
<label><?php echo __('ZIP','eagle-booking') ?></label>
</div>
<?php endif ?>
</div>
</div>

View File

@@ -0,0 +1,74 @@
<?php
/**
* The Template for the signed in user
*
* This template can be overridden by copying it to yourtheme/eb-templates/booking/form/coupon.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1
*/
defined('ABSPATH') || exit;
?>
<div id="eb_signed_in_user" style="<?php if ( !is_user_logged_in() ) echo esc_attr('display: none;') ?>">
<div class="eb-alert eb-alert-success eb-alert-small eb-alert-icon mb25">
<span id="eb_signed_in_user_text"><?php echo __('Logged in as', 'eagle-booking') ?>, <?php echo $eb_current_user->user_login ?>!</span>
<span id="eb_user_sign_out" class="pull-right" style="cursor: pointer;"><?php echo __('Log Out', 'eagle-booking') ?></span>
</div>
<div class="eb-g-lg-2 eb-g-md-1">
<div class="eb-form-col">
<input type="text" id="eb_signed_in_user_first_name" class="eb-field" value="<?php eb_user('first_name') ?>">
<label><?php echo __('First Name','eagle-booking') ?></label>
</div>
<div class="eb-form-col">
<input type="text" id="eb_signed_in_user_last_name" class="eb-field" value="<?php eb_user('last_name') ?>">
<label><?php echo __('Last Name','eagle-booking') ?> </label>
</div>
<div class="eb-form-col">
<input type="email" id="eb_signed_in_user_email" class="eb-field" value="<?php eb_user('user_email') ?>">
<label><?php echo __('Email','eagle-booking') ?></label>
</div>
<input type="tel" id="eb_signed_in_user_phone" class="eb_user_phone_field eb-field" placeholder="<?php echo __('Phone','eagle-booking') ?> *" value="<?php eb_user('user_phone') ?>">
<?php if ( eb_get_option('eb_booking_form_fields')['address'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_signed_in_user_address" class="eb-field" value="<?php eb_user('user_address') ?>">
<label><?php echo __('Address','eagle-booking') ?><label>
</div>
<?php endif ?>
<?php if ( eb_get_option('eb_booking_form_fields')['city'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_signed_in_user_city" class="eb-field" value="<?php eb_user('user_city') ?>">
<label><?php echo __('City','eagle-booking') ?><label>
</div>
<?php endif ?>
<?php if ( eb_get_option('eb_booking_form_fields')['country'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_signed_in_user_country" class="eb-field" value="<?php eb_user('user_country') ?>">
<label><?php echo __('Country','eagle-booking') ?><label>
</div>
<?php endif ?>
<?php if ( eb_get_option('eb_booking_form_fields')['zip'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_signed_in_user_zip" class="eb-field" value="<?php eb_user('user_zip') ?>">
<label><?php echo __('ZIP','eagle-booking') ?><label>
</div>
<?php endif ?>
</div>
</div>

View File

@@ -0,0 +1,38 @@
<?php
/**
* The Template for the signin form
*
* This template can be overridden by copying it to yourtheme/eb-templates/booking/form/coupon.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.1
*/
defined('ABSPATH') || exit;
?>
<div class="eb-tab-content signin" data-tab="signin">
<div id="eb_user_sign_in_response" class="eb-alert eb-alert-small mb20" style="display: none">
<span id="eb_user_sign_in_response_text"></span>
</div>
<form class="eb-g-3-3-1 eb-g-m-1" id="eb_user_sign_in_form">
<div class="eb-form-col">
<input type="text" id="eb_user_sign_in_username" class="eb-field">
<label><?php echo __('Username or Email Address', 'eagle-booking') ?></label>
</div>
<div class="eb-form-col">
<input type="password" id="eb_user_sign_in_password" class="eb-field" autocomplete="on">
<label><?php echo __('Password', 'eagle-booking') ?></label>
</div>
<button id="eb_user_sign_in" class="btn eb-btn btn-full" type="submit">
<span class="eb-btn-text"><?php echo __('Sign In','eagle-booking') ?></span>
</button>
</form>
</div>

View File

@@ -0,0 +1,82 @@
<?php
/**
* The Template for the signup form
*
* This template can be overridden by copying it to yourtheme/eb-templates/booking/form/coupon.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.0
*/
defined('ABSPATH') || exit;
?>
<div class="eb-tab-content signup" data-tab="signup">
<form id="eb_user_signup_booking_form" action="" method="POST">
<div id="eb_user_sign_up_response" class="eb-alert eb-alert-small mb20" role="alert" style="display:none">
<span id="eb_user_sign_up_response_text"></span>
</div>
<div class="eb-g-lg-2 eb-g-md-1">
<div class="eb-form-col">
<input type="email" id="eb_user_sign_up_username" class="eb-field">
<label><?php echo __('Username','eagle-booking') ?></label>
</div>
<div class="eb-form-col">
<input type="email" id="eb_user_sign_up_email" class="eb-field">
<label><?php echo __('Email','eagle-booking') ?></label>
</div>
<div class="eb-form-col">
<input type="password" id="eb_user_sign_up_password" class="eb-field" autocomplete="on">
<label><?php echo __('Password','eagle-booking') ?></label>
</div>
<div class="eb-form-col">
<input type="text" id="eb_user_sign_up_first_name" class="eb-field">
<label><?php echo __('First Name','eagle-booking') ?></label>
</div>
<div class="eb-form-col">
<input type="text" id="eb_user_sign_up_last_name" class="eb-field">
<label><?php echo __('Last Name','eagle-booking') ?></label>
</div>
<input type="tel" id="eb_user_sign_up_phone" class="eb_user_phone_field eb-field" placeholder="<?php echo __('Phone','eagle-booking') ?> *">
<?php if ( eb_get_option('eb_booking_form_fields')['address'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_user_sign_up_address" class="eb-field">
<label><?php echo __('Address','eagle-booking') ?></label>
</div>
<?php endif ?>
<?php if ( eb_get_option('eb_booking_form_fields')['city'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_user_sign_up_city" class="eb-field">
<label><?php echo __('City','eagle-booking') ?></label>
</div>
<?php endif ?>
<?php if ( eb_get_option('eb_booking_form_fields')['country'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_user_sign_up_country" class="eb-field">
<label><?php echo __('Country','eagle-booking') ?></label>
</div>
<?php endif ?>
<?php if ( eb_get_option('eb_booking_form_fields')['zip'] == true ) : ?>
<div class="eb-form-col">
<input type="text" id="eb_user_sign_up_zip" class="eb-field">
<label><?php echo __('ZIP','eagle-booking') ?></label>
</div>
<?php endif ?>
</div>
</form>
</div>

View File

@@ -0,0 +1,5 @@
<!-- Terms -->
<div class="mt50 gdpr">
<input type="checkbox" id="eb_terms" value="0">
<label for="eb_terms"><?php echo __('I agree to the', 'eagle-booking') ?> <a class="terms-conditions" target="_blank" href="<?php echo eagle_booking_terms_page() ?>"><?php echo __('Terms and Conditions','eagle-booking') ?></a></label>
</div>

View File

@@ -0,0 +1,25 @@
<?php
/**
* The Template for the notification mssg
*
* This template can be overridden by copying it to yourtheme/eb-templates/booking/notification-mssg.php.
*
* Author: Eagle Themes
* Package: Eagle-Booking/Templates
* Version: 1.0
*/
defined('ABSPATH') || exit;
?>
<?php
if ( eb_get_option('booking_page_mssg') ) : ?>
<div class="eb-alert eb-alert-info eb-alert-icon mb50" role="alert">
<div class="alert-inner">
<?php echo wp_kses_post(eb_get_option('booking_page_mssg')) ?>
</div>
</div>
<?php endif ?>

View File

@@ -0,0 +1,105 @@
<?php
$eb_taxes = array();
$eb_fees = array();
$eb_room_taxes = array();
$eb_room_fees = array();
// Get All Taxes & Fees
$eb_taxes = get_option('eb_taxes');
$eb_fees = get_option('eb_fees');
// Get taxes & fees asigned to the room
$eb_room_taxes = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_taxes', true );
$eb_room_fees = get_post_meta ( $eb_room_id, 'eagle_booking_mtb_room_fees', true );
if ( empty( $eb_taxes ) ) $eb_taxes = array();
if ( empty( $eb_fees ) ) $eb_fees = array();
if ( empty( $eb_room_taxes ) ) $eb_room_taxes = array();
if ( empty( $eb_room_fees ) ) $eb_room_fees = array();
// Merge Taxes & Fees
$eb_entries = array_merge( $eb_taxes, $eb_fees );
$eb_room_entries = array_merge( $eb_room_taxes, $eb_room_fees );
if ( empty( $eb_room_entries ) ) $eb_room_entries = array();
$html = '';
if ( eb_get_option('eb_adults_children') == true ) {
$guests = $eb_adults + $eb_children;
} else {
$guests = $eb_guests;
}
if ( $eb_entries ) {
$total_amount = 0;
$taxes_fees_amount = 0;
foreach( $eb_entries as $key => $item ) {
$entry_id = !empty( $item["id"] ) ? $item["id"] : '';
$entry_title = !empty( $item["title"] ) ? $item["title"] : '';
$type = !empty( $item["type"] ) ? $item["type"] : '';
$amount = !empty( $item["amount"] ) ? $item["amount"] : '';
$global = !empty( $item["global"] ) ? $item["global"] : '';
$services = !empty( $item["services"] ) ? $item["services"] : '';
$fees = !empty( $item["fees"] ) ? $item["fees"] : '';
if ( $item["global"] == true || in_array( $entry_id, $eb_room_entries) ) {
// Calculate the tax & fees total based on the type
if ( $type === 'per_booking' ) {
$taxes_fees_amount = $amount;
} elseif ( $type === 'per_booking_nights' ) {
$taxes_fees_amount = $amount * $eb_booking_nights;
} elseif ( $type === 'per_guests' ) {
$taxes_fees_amount = $amount * $guests;
} elseif ( $type === 'per_booking_nights_guests' ) {
$taxes_fees_amount = $amount * $guests * $eb_booking_nights;
} else {
$taxes_fees_amount = $amount * $eb_trip_price / 100;
}
// Check if is tax or fee
if( $services != '' ) {
$id = 'tax-id='.$entry_id.'';
$data = 'data-amount='.round( $taxes_fees_amount).' data-percentage='.$amount.'';
} else {
$id = 'vat-id='.$entry_id.'';
$data = 'data-amount='.round( $taxes_fees_amount).'';
}
$html .= "<div class='item taxfee' data-$id $data>";
$html .= "<span class='desc'>$entry_title</span>";
$html .= "<span class='value'><strong>".eb_price( round( $taxes_fees_amount ) ). "</strong></span>";
$html .= "</div>";
}
// Get the total cost of the taxes
$total_amount += $taxes_fees_amount;
}
// Add the total tax cost to the total price
$eb_trip_price = $eb_trip_price + $total_amount;
}
echo $html;