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:
234
wp-content/plugins/eagle-booking/core/shortcodes/rooms.php
Normal file
234
wp-content/plugins/eagle-booking/core/shortcodes/rooms.php
Normal file
@@ -0,0 +1,234 @@
|
||||
<?php
|
||||
/*---------------------------------------------------------------------------------
|
||||
* Eagle Booking Rooms Shortcodes
|
||||
* Since: 1.3.2
|
||||
* Modified: 1.3.3
|
||||
* Author: Eagle Themes
|
||||
* Shortcode: [eb_rooms]
|
||||
* Parameters: view, branch_id, items, items_per_row, items_per_view, order_by, offset
|
||||
* View: Normal, Grid, List, Carousel
|
||||
-----------------------------------------------------------------------------------*/
|
||||
if ( !function_exists('eb_rooms_shortcode') ) {
|
||||
|
||||
function eb_rooms_shortcode($atts, $content = null) {
|
||||
|
||||
extract( shortcode_atts ( array(
|
||||
'view' => '', // Normal, Grid, List, Carousel
|
||||
'branch_id' => '',
|
||||
'items' => '5',
|
||||
'items_per_row' => '', // Only for Normal
|
||||
'items_per_view' => '', // Only for Carousel
|
||||
'carousel_nav' => '', // Only for Carousel default: true
|
||||
'offset' => '',
|
||||
'orderby' => '',
|
||||
'order' => '',
|
||||
'layout' => '',
|
||||
'columns' => '',
|
||||
|
||||
), $atts));
|
||||
|
||||
ob_start();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'eagle_rooms',
|
||||
'posts_per_page' => $items,
|
||||
'orderby' => $orderby,
|
||||
'order' => $order,
|
||||
'offset' => $offset,
|
||||
);
|
||||
|
||||
/**
|
||||
* Sort by branch
|
||||
*/
|
||||
if ( isset($branch_id) && $branch_id != '' && $branch_id != '0' ) {
|
||||
|
||||
$args['tax_query'][] = array(
|
||||
'taxonomy' => 'eagle_branch',
|
||||
'field' => 'term_id',
|
||||
'terms' => $branch_id,
|
||||
);
|
||||
}
|
||||
|
||||
$eb_rooms_qry = new WP_Query($args);
|
||||
|
||||
/**
|
||||
* Rooms Layout View
|
||||
*/
|
||||
|
||||
// Check if the new attr 'layout and columns' has been set otherwise use the old one
|
||||
if ( empty( $layout ) ) $layout = $view;
|
||||
if ( empty( $columns ) ) $columns = $items_per_row;
|
||||
|
||||
switch ($layout) {
|
||||
|
||||
case 'normal':
|
||||
|
||||
$eb_rooms_room_view = 'grid';
|
||||
$eb_rooms_view_class = 'normal'.' eb-g-md-'.$columns.' eb-g-sm-1';
|
||||
|
||||
break;
|
||||
|
||||
case 'grid':
|
||||
|
||||
$eb_rooms_room_view = 'grid';
|
||||
$eb_rooms_view_class = 'grid';
|
||||
|
||||
break;
|
||||
|
||||
case 'list':
|
||||
|
||||
$eb_rooms_room_view = 'list';
|
||||
$eb_rooms_view_class = 'list';
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
$eb_rooms_room_view = 'grid';
|
||||
$eb_rooms_view_class = 'carousel'. ' owl-carousel ' .wp_generate_password(5, false, false);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Load Carousel Script
|
||||
*/
|
||||
if ( $layout == 'carousel' ) :
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
jQuery(function($) {
|
||||
var owl = $('.eb-rooms-carousel <?php wp_generate_password(5, false, false) ?>');
|
||||
owl.owlCarousel({
|
||||
loop: false,
|
||||
margin: 30,
|
||||
nav: <?php if ( $carousel_nav != '' && $carousel_nav == 'false' ) { echo 'false'; } else { echo 'true'; } ?>,
|
||||
dots: false,
|
||||
navText: [
|
||||
"<i class='fa fa-angle-left' aria-hidden='true'></i>",
|
||||
"<i class='fa fa-angle-right' aria-hidden='true'></i>"
|
||||
],
|
||||
responsive: {
|
||||
|
||||
0: {
|
||||
items: 1
|
||||
},
|
||||
|
||||
480: {
|
||||
items: 2
|
||||
},
|
||||
|
||||
768: {
|
||||
items: 3
|
||||
},
|
||||
|
||||
992: {
|
||||
items: <?php echo $columns ? $columns : '4' ?>
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
|
||||
if ( $layout == 'grid' && $eb_rooms_qry->found_posts < 5 ) {
|
||||
|
||||
if( current_user_can('administrator') ) {
|
||||
|
||||
echo "<div class='eb-alert eb-alert-error eb-alert-admin-only eb-alert-icon'>";
|
||||
echo __('The selected style requires at least 5 items', 'eagle-booking' );
|
||||
echo "</div>";
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
?>
|
||||
<div class="eb-rooms-<?php echo $eb_rooms_view_class ?>">
|
||||
|
||||
<?php
|
||||
|
||||
$eb_rooms_counter = 0;
|
||||
|
||||
if ( $eb_rooms_qry->have_posts() ): while ( $eb_rooms_qry->have_posts() ): $eb_rooms_qry->the_post();
|
||||
|
||||
$eb_room_id = get_the_ID();
|
||||
$eb_room_title = get_the_title();
|
||||
$eb_room_url = get_permalink();
|
||||
$eb_room_img_url = get_the_post_thumbnail_url('', 'eagle_booking_image_size_720_470');
|
||||
$eb_room_price = eagle_booking_room_min_price($eb_room_id);
|
||||
$eb_room_description = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_description', true );
|
||||
|
||||
$eb_rooms_counter++;
|
||||
|
||||
/**
|
||||
* Add container class
|
||||
*/
|
||||
if ( $eb_rooms_counter == 1 ) {
|
||||
|
||||
$eb_rooms_columns_class = 'first';
|
||||
|
||||
} else {
|
||||
|
||||
$eb_rooms_columns_class = 'second';
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add 'small' class to all items except the 1st one
|
||||
*/
|
||||
$eb_room_item_class = '';
|
||||
|
||||
if ( $layout == 'grid' && $eb_rooms_counter != 1 ) $eb_room_item_class .= 'small-item';
|
||||
|
||||
/**
|
||||
* Open before 1st and on 2nd item
|
||||
*/
|
||||
if ( $layout == 'grid' && ( $eb_rooms_counter == 1 || $eb_rooms_counter == 2 ) ) echo '<div class="'.$eb_rooms_columns_class.'-col">';
|
||||
|
||||
|
||||
/**
|
||||
* Include room grid
|
||||
*/
|
||||
include eb_load_template('room-'.$eb_rooms_room_view.'.php');
|
||||
|
||||
|
||||
/**
|
||||
* Close after 1st and 5th item
|
||||
*/
|
||||
if ( $layout == 'grid' && ( $eb_rooms_counter == 1 || $eb_rooms_counter == 5 ) ) { echo '</div>'; }
|
||||
|
||||
/**
|
||||
* End loop and reset it
|
||||
*/
|
||||
endwhile; endif; wp_reset_postdata();
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
$result = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
add_shortcode('eb_rooms', 'eb_rooms_shortcode');
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Include All EB Shortcodes & VC / Elementor Options
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
include_once EB_PATH . '/core/shortcodes/rooms.php';
|
||||
|
||||
include_once EB_PATH . '/core/shortcodes/testimonials.php';
|
||||
|
||||
include_once EB_PATH . '/core/shortcodes/vc/rooms.php';
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/*---------------------------------------------------------------------------------
|
||||
* Eagle Booking Testimonials/Reviews Shortcode
|
||||
* Since: 1.3.5
|
||||
* Author: Eagle Themes
|
||||
* Shortcode: [eb_testimonials]
|
||||
* Parameters: items, columns, columns_tablet, columns_mobile, navigation, order, order_by, layout = carousel | normal
|
||||
-----------------------------------------------------------------------------------*/
|
||||
if( !function_exists('eb_testimonials') ) {
|
||||
|
||||
function eb_testimonials( $atts, $content = null ) {
|
||||
|
||||
extract( shortcode_atts ( array(
|
||||
|
||||
'items' => '',
|
||||
'columns' => '',
|
||||
'columns_tablet' => '',
|
||||
'columns_mobile' => '',
|
||||
'offset' => '',
|
||||
'orderby' => '',
|
||||
'order' => '',
|
||||
'layout' => '',
|
||||
'navigation' => '',
|
||||
|
||||
|
||||
), $atts));
|
||||
|
||||
ob_start();
|
||||
|
||||
$eb_query_args = array(
|
||||
'post_type' => 'eagle_reviews',
|
||||
'posts_per_page' => $items,
|
||||
'orderby' => $orderby,
|
||||
'order' => $order,
|
||||
'offset' => $offset
|
||||
);
|
||||
|
||||
$eb_review_qry = new \WP_Query($eb_query_args);
|
||||
$eb_unique_token = wp_generate_password(5, false, false);
|
||||
|
||||
$class = '';
|
||||
|
||||
$desktop_cols = !empty( $columns ) ? $columns : 4;
|
||||
$tablet_cols = !empty( $columns_tablet ) ? $columns_tablet : 3;
|
||||
$mobile_cols = !empty( $columns_mobile ) ? $columns_mobile : 1;
|
||||
|
||||
|
||||
if ( $layout === 'carousel' ) { ?>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
jQuery(function($) {
|
||||
|
||||
var owl = $('#testimonials-<?php echo esc_attr( $eb_unique_token ) ?>');
|
||||
owl.owlCarousel({
|
||||
loop: true,
|
||||
margin: 30,
|
||||
dots: <?php echo $navigation ? 'true' : 'false' ?>,
|
||||
nav: false,
|
||||
responsive: {
|
||||
|
||||
0: {
|
||||
items: <?php echo $mobile_cols ?>
|
||||
},
|
||||
|
||||
768: {
|
||||
items: <?php echo $tablet_cols ?>
|
||||
},
|
||||
|
||||
992: {
|
||||
items: <?php echo $desktop_cols ?>
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
$class .= 'owl-carousel testimonials-owl';
|
||||
|
||||
} else {
|
||||
|
||||
$class = 'eb-g-lg-'.$desktop_cols.' '.'eb-g-md-'.$tablet_cols.' '.'eb-g-sm-'.$mobile_cols;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="testimonials">
|
||||
|
||||
<div id="<?php echo esc_attr( 'testimonials-'.$eb_unique_token ) ?>" class="<?php echo esc_attr( $class ) ?>">
|
||||
<?php
|
||||
|
||||
if ($eb_review_qry->have_posts()): while ($eb_review_qry->have_posts()) : $eb_review_qry->the_post();
|
||||
|
||||
$eb_review_author_name = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_author', true );
|
||||
$eb_review_avatar_file_id = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_image_id', true );
|
||||
$eb_review_avatar = wp_get_attachment_image_url( $eb_review_avatar_file_id);
|
||||
$eb_review_author_location = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_author_location', true );
|
||||
$eb_review_rating = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_rating', true );
|
||||
$eb_review_quote = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_quote', true );
|
||||
|
||||
?>
|
||||
|
||||
<div class="testimonial-item">
|
||||
<div class="author-img">
|
||||
<img alt="<?php echo esc_html( $eb_review_author_name ) ?>" class="img-fluid" src="<?php echo esc_url( $eb_review_avatar ) ?>">
|
||||
</div>
|
||||
<div class="author">
|
||||
<h4 class="name"><?php echo esc_html( $eb_review_author_name ) ?></h4>
|
||||
<div class="location"><?php echo esc_html( $eb_review_author_location ) ?></div>
|
||||
</div>
|
||||
<div class="rating">
|
||||
<?php
|
||||
|
||||
for( $x = 1; $x <= $eb_review_rating; $x++ ) {
|
||||
|
||||
echo '<i class="fa fa-star voted" aria-hidden="true"></i>';
|
||||
}
|
||||
|
||||
if ( strpos( $eb_review_rating,'.' ) ) {
|
||||
|
||||
echo '<i class="fa fa-star" aria-hidden="true"></i>';
|
||||
|
||||
$x++;
|
||||
}
|
||||
|
||||
while ( $x <= 5 ) {
|
||||
|
||||
echo '<i class="fa fa-star" aria-hidden="true"></i>';
|
||||
|
||||
$x++;
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
<p><?php echo esc_html( $eb_review_quote ) ?></p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php endwhile; endif; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$result = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $result;
|
||||
}
|
||||
|
||||
add_shortcode('eb_testimonials', 'eb_testimonials');
|
||||
}
|
||||
162
wp-content/plugins/eagle-booking/core/shortcodes/vc/rooms.php
Normal file
162
wp-content/plugins/eagle-booking/core/shortcodes/vc/rooms.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
/**
|
||||
* VC Rooms Shortcode Options
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/eb-templates/room-grid.php.
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.6
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
|
||||
add_action( 'vc_before_init', 'eb_vc_rooms_shortcode' );
|
||||
|
||||
function eb_vc_rooms_shortcode() {
|
||||
|
||||
vc_map( array(
|
||||
"name" => esc_html__( "Rooms", "eagle-booking" ),
|
||||
"description" => '',
|
||||
"base" => "eb_rooms",
|
||||
'category' => esc_html__("Eagle Booking",'eagle-booking'),
|
||||
"class" => "",
|
||||
'admin_enqueue_js' => "",
|
||||
"icon" => "icon-eagle",
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"param_name" => "view",
|
||||
"type" => "dropdown",
|
||||
"value" => array(
|
||||
'Normal' => 'normal',
|
||||
'Grid' => 'grid',
|
||||
'List' => 'list',
|
||||
'Carousel' => 'carousel'
|
||||
),
|
||||
"default" => "3",
|
||||
"heading" => esc_html__("View", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "branch_id",
|
||||
"type" => "dropdown",
|
||||
"value" => eb_sort_by_branch('bakery'),
|
||||
"heading" => __("Branch", "eagle-booking"),
|
||||
"description" => '',
|
||||
"save_always" => false,
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "items",
|
||||
"type" => "textfield",
|
||||
"value" => "6",
|
||||
"heading" => esc_html__("Items", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true,
|
||||
'dependency' => array(
|
||||
'element' => 'view',
|
||||
'value' => array('normal', 'list', 'carousel')
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "items_per_row",
|
||||
"type" => "dropdown",
|
||||
"value" => array(
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6'
|
||||
),
|
||||
"default" => "3",
|
||||
"heading" => esc_html__("Items per row", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true,
|
||||
'dependency' => array(
|
||||
'element' => 'view',
|
||||
'value' => 'normal'
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "columns",
|
||||
"type" => "dropdown",
|
||||
"value" => array(
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6'
|
||||
),
|
||||
"default" => "3",
|
||||
"heading" => esc_html__("Items per view", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true,
|
||||
'dependency' => array(
|
||||
'element' => 'view',
|
||||
'value' => 'carousel'
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => "Navigation buttons",
|
||||
"param_name" => "carousel_nav",
|
||||
"value" => array(
|
||||
"True" => "true",
|
||||
"False" => "false",
|
||||
),
|
||||
"default" => true,
|
||||
'dependency' => array(
|
||||
'element' => 'view',
|
||||
'value' => 'carousel'
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "orderby",
|
||||
"type" => "dropdown",
|
||||
"value" => array(
|
||||
'None' => 'none',
|
||||
'ID' => 'ID',
|
||||
'Title' => 'title',
|
||||
'Date' => 'date',
|
||||
'Random' => 'rand',
|
||||
'Menu Order' => 'menu_order'
|
||||
),
|
||||
"heading" => esc_html__("Order by", "eagle-booking"),
|
||||
"description" => '',
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "order",
|
||||
"type" => "dropdown",
|
||||
"value" => array(
|
||||
'ASC' => 'ASC',
|
||||
'DESC' => 'DESC'
|
||||
),
|
||||
"heading" => esc_html__("Order", "eagle-booking"),
|
||||
"description" => '',
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "offset",
|
||||
"type" => "textfield",
|
||||
"value" => "",
|
||||
"heading" => esc_html__("Offset", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true
|
||||
),
|
||||
)
|
||||
|
||||
));
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user