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:
350
wp-content/plugins/eagle-booking/core/vc/rooms/index.php
Normal file
350
wp-content/plugins/eagle-booking/core/vc/rooms/index.php
Normal file
@@ -0,0 +1,350 @@
|
||||
<?php
|
||||
/*---------------------------------------------------------------------------------
|
||||
ROOMS VC ELEMENT SETTINGS/OPTIONS - Deprecated
|
||||
-----------------------------------------------------------------------------------*/
|
||||
add_action( 'vc_before_init', 'eagle_booking_rooms_vc' );
|
||||
function eagle_booking_rooms_vc() {
|
||||
|
||||
/*---------------------------------------------------------------------------------
|
||||
ROOMS NORMAL VIEW VC ELEMENT
|
||||
-----------------------------------------------------------------------------------*/
|
||||
vc_map( array(
|
||||
"name" => esc_html__( "Rooms (Deprecated)", "eagle-booking" ),
|
||||
"description" => '',
|
||||
"base" => "eagle-booking-rooms",
|
||||
'category' => esc_html__("Eagle Themes",'eagle-booking'),
|
||||
"class" => "",
|
||||
'admin_enqueue_js' => "",
|
||||
'admin_enqueue_css' => get_template_directory_uri()."/assets/css/admin/global.css",
|
||||
'front_enqueue_css' => get_template_directory_uri()."/assets/css/admin/global.css",
|
||||
"icon" => "icon-eagle",
|
||||
"deprecated" => true,
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"param_name" => "branch_id",
|
||||
"type" => "dropdown",
|
||||
"value" => eb_sort_by_branch(),
|
||||
"heading" => __("Branch:", "eagle-booking"),
|
||||
"description" => '',
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "rooms_limit",
|
||||
"type" => "textfield",
|
||||
"value" => "6",
|
||||
"heading" => esc_html__("Items:", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"param_name" => "rooms_per_row",
|
||||
"type" => "dropdown",
|
||||
"value" => array(
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'6' => '6'
|
||||
),
|
||||
"default" => "3",
|
||||
"heading" => esc_html__("Items per row:", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true,
|
||||
),
|
||||
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
|
||||
),
|
||||
|
||||
)
|
||||
|
||||
));
|
||||
|
||||
/*---------------------------------------------------------------------------------
|
||||
ROOMS LIST VIEW VC ELEMENT
|
||||
-----------------------------------------------------------------------------------*/
|
||||
vc_map( array(
|
||||
"name" => esc_html__( "Rooms List (Deprecated)", "eagle-booking" ),
|
||||
"description" => '',
|
||||
"base" => "eagle-booking-rooms-list",
|
||||
'category' => esc_html__("Eagle Themes",'eagle-booking'),
|
||||
"class" => "",
|
||||
'admin_enqueue_js' => "",
|
||||
'admin_enqueue_css' => get_template_directory_uri()."/assets/css/admin/global.css",
|
||||
'front_enqueue_css' => get_template_directory_uri()."/assets/css/admin/global.css",
|
||||
"icon" => "icon-eagle",
|
||||
"deprecated" => true,
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"param_name" => "branch_id",
|
||||
"type" => "dropdown",
|
||||
"value" => eb_sort_by_branch(),
|
||||
"heading" => __("Branch:", "eagle-booking"),
|
||||
"description" => '',
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "rooms_limit",
|
||||
"type" => "textfield",
|
||||
"value" => "6",
|
||||
"heading" => esc_html__("Items:", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "branch",
|
||||
"type" => "dropdown",
|
||||
"value" => 'eagle_branch',
|
||||
"heading" => esc_html__("Branch:", "eagle-booking"),
|
||||
"description" => '',
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
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
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
|
||||
/*---------------------------------------------------------------------------------
|
||||
ROOMS GRID VC ELEMENT SETTINGS
|
||||
-----------------------------------------------------------------------------------*/
|
||||
vc_map( array(
|
||||
"name" => esc_html__( "Rooms Grid (Deprecated)", "eagle-booking" ),
|
||||
"description" => '',
|
||||
"base" => "eagle-booking-rooms-grid",
|
||||
'category' => esc_html__("Eagle Themes",'eagle-booking'),
|
||||
"class" => "",
|
||||
'admin_enqueue_js' => "",
|
||||
'admin_enqueue_css' => get_template_directory_uri()."/assets/css/admin/global.css",
|
||||
'front_enqueue_css' => get_template_directory_uri()."/assets/css/admin/global.css",
|
||||
"icon" => "icon-eagle",
|
||||
"deprecated" => true,
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"param_name" => "branch_id",
|
||||
"type" => "dropdown",
|
||||
"value" => eb_sort_by_branch(),
|
||||
"heading" => __("Branch:", "eagle-booking"),
|
||||
"description" => '',
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
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
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------------
|
||||
ROOMS CAROUSEL VC ELEMENTS SETTINGS
|
||||
-----------------------------------------------------------------------------------*/
|
||||
vc_map( array(
|
||||
"name" => esc_html__( "Rooms Carousel (Deprecated)", "eagle-booking" ),
|
||||
"description" => '',
|
||||
"base" => "eagle-booking-rooms-carousel",
|
||||
'category' => esc_html__("Eagle Themes",'eagle-booking'),
|
||||
"class" => "",
|
||||
'admin_enqueue_js' => "",
|
||||
'admin_enqueue_css' => get_template_directory_uri()."/assets/css/admin/global.css",
|
||||
'front_enqueue_css' => get_template_directory_uri()."/assets/css/admin/global.css",
|
||||
"icon" => "icon-eagle",
|
||||
"deprecated" => true,
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"param_name" => "branch_id",
|
||||
"type" => "dropdown",
|
||||
"value" => eb_sort_by_branch(),
|
||||
"heading" => __("Branch:", "eagle-booking"),
|
||||
"description" => '',
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "rooms_limit",
|
||||
"type" => "textfield",
|
||||
"value" => "6",
|
||||
"heading" => esc_html__("Items:", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"param_name" => "rooms_per_view",
|
||||
"type" => "dropdown",
|
||||
"value" => array(
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5'
|
||||
),
|
||||
"default" => "3",
|
||||
"heading" => esc_html__("Items per View:", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true,
|
||||
),
|
||||
|
||||
array(
|
||||
"type" => "dropdown",
|
||||
"class" => "",
|
||||
"heading" => "Navigation Buttons",
|
||||
"param_name" => "gallery_carousel_nav",
|
||||
"value" => array(
|
||||
"True" => true,
|
||||
"False" => false,
|
||||
),
|
||||
"default" => true,
|
||||
),
|
||||
|
||||
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
|
||||
),
|
||||
)
|
||||
|
||||
));
|
||||
|
||||
|
||||
}
|
||||
|
||||
foreach ( glob ( plugin_dir_path( __FILE__ ) . "layout/*.php" ) as $file ){
|
||||
include_once $file;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/*---------------------------------------------------------------------------------
|
||||
ROOMS CAROUSEL VC ELEMENT
|
||||
-----------------------------------------------------------------------------------*/
|
||||
if( !function_exists('eagle_rooms_carousel') ) {
|
||||
function eagle_rooms_carousel($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
'branch_id' => '',
|
||||
'rooms_limit' => '',
|
||||
'rooms_per_view' => '',
|
||||
'gallery_carousel_nav' => '',
|
||||
'offset' => '',
|
||||
'orderby' => '',
|
||||
'order' => '',
|
||||
), $atts));
|
||||
|
||||
ob_start();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'eagle_rooms',
|
||||
'posts_per_page' => $rooms_limit,
|
||||
'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,
|
||||
);
|
||||
}
|
||||
|
||||
$rooms_qry = new WP_Query($args);
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
$token = wp_generate_password(5, false, false);
|
||||
?>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
function gallery_carousel() {
|
||||
$('#rooms-carousel-<?php echo esc_attr( $token ); ?>').owlCarousel({
|
||||
loop: false,
|
||||
margin: 30,
|
||||
<?php if( $gallery_carousel_nav == true) : ?>
|
||||
nav: true,
|
||||
<?php endif ?>
|
||||
navText: [
|
||||
"<i class='fa fa-angle-left' aria-hidden='true'></i>",
|
||||
"<i class='fa fa-angle-right' aria-hidden='true'></i>"
|
||||
],
|
||||
|
||||
responsiveClass:true,
|
||||
responsive:{
|
||||
|
||||
0:{
|
||||
items: 1,
|
||||
nav: false
|
||||
},
|
||||
|
||||
600:{
|
||||
items: 2,
|
||||
nav: true
|
||||
},
|
||||
|
||||
1000:{
|
||||
items: <?php echo esc_attr( $rooms_per_view ); ?>,
|
||||
nav: true,
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
setTimeout(gallery_carousel, 1)
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="rooms-carousel-<?php echo esc_attr( $token ); ?>" class="rooms-carousel owl-carousel">
|
||||
<?php
|
||||
if ($rooms_qry->have_posts()): while ($rooms_qry->have_posts()): $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);
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Include room grid
|
||||
*/
|
||||
include eb_load_template('room-grid.php');
|
||||
|
||||
?>
|
||||
|
||||
<?php endwhile; endif; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$result = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $result;
|
||||
}
|
||||
|
||||
add_shortcode('eagle-booking-rooms-carousel', 'eagle_rooms_carousel');
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/*---------------------------------------------------------------------------------
|
||||
ROOMS VC ELEMENT
|
||||
-----------------------------------------------------------------------------------*/
|
||||
if( !function_exists('eagle_rooms_grid') ) {
|
||||
|
||||
function eagle_rooms_grid($atts, $content = null) {
|
||||
|
||||
extract( shortcode_atts ( array(
|
||||
|
||||
'branch_id' => '',
|
||||
'rooms_limit' => '5',
|
||||
'offset' => '',
|
||||
'orderby' => '',
|
||||
'order' => '',
|
||||
|
||||
), $atts));
|
||||
|
||||
ob_start();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'eagle_rooms',
|
||||
'posts_per_page' => $rooms_limit,
|
||||
'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);
|
||||
|
||||
?>
|
||||
|
||||
<div class="eb-rooms-grid">
|
||||
|
||||
<?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_rooms_counter++;
|
||||
|
||||
/**
|
||||
* Add container class
|
||||
*/
|
||||
if ( $eb_rooms_counter == 1 ) {
|
||||
|
||||
$eb_rooms_columns_class = 'first';
|
||||
|
||||
} else {
|
||||
|
||||
$eb_rooms_columns_class = 'second';
|
||||
|
||||
}
|
||||
|
||||
$eb_room_item_class = '';
|
||||
|
||||
/**
|
||||
* Add 'small' class to all items except the 1st one
|
||||
*/
|
||||
if ( $eb_rooms_counter != 1 ) $eb_room_item_class .= 'small-item';
|
||||
|
||||
/**
|
||||
* Open before 1st and on 2nd item
|
||||
*/
|
||||
if ( $eb_rooms_counter == 1 || $eb_rooms_counter == 2 ) echo '<div class="'.$eb_rooms_columns_class.'-col">';
|
||||
|
||||
|
||||
/**
|
||||
* Include room grid
|
||||
*/
|
||||
include eb_load_template('room-grid.php');
|
||||
|
||||
/**
|
||||
* Close after 1st and 5th item
|
||||
*/
|
||||
if ( $eb_rooms_counter == 1 || $eb_rooms_counter == 5 ) echo '</div>';
|
||||
|
||||
?>
|
||||
|
||||
<?php endwhile; endif; wp_reset_postdata();
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$result = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Old shortcode
|
||||
add_shortcode('eagle-booking-rooms-grid', 'eagle_rooms_grid');
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/*---------------------------------------------------------------------------------
|
||||
ROOMS VC ELEMENT
|
||||
-----------------------------------------------------------------------------------*/
|
||||
if( !function_exists('eagle_rooms_list') ) {
|
||||
function eagle_rooms_list($atts, $content = null) {
|
||||
extract(shortcode_atts(array(
|
||||
|
||||
'branch_id' => '',
|
||||
'rooms_limit' => '',
|
||||
'rooms_per_row' => '',
|
||||
'offset' => '',
|
||||
'orderby' => '',
|
||||
'order' => '',
|
||||
|
||||
), $atts));
|
||||
|
||||
ob_start();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'eagle_rooms',
|
||||
'posts_per_page' => $rooms_limit,
|
||||
'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,
|
||||
);
|
||||
}
|
||||
|
||||
$rooms_qry = new WP_Query($args);
|
||||
?>
|
||||
|
||||
<?php if ($rooms_qry->have_posts()): while ($rooms_qry->have_posts()) : $rooms_qry->the_post();
|
||||
|
||||
// Default
|
||||
$eb_room_id = get_the_ID();
|
||||
$eb_room_title = get_the_title();
|
||||
$eb_room_url = get_permalink();
|
||||
$eb_room_image = get_the_post_thumbnail_url();
|
||||
|
||||
// MTB
|
||||
$eb_room_price = get_post_meta(get_the_ID(), 'eagle_booking_mtb_room_price', true);
|
||||
$eb_room_header = get_post_meta(get_the_ID(), 'eagle_booking_mtb_room_header', true);
|
||||
$eagke_booking_room_sidebar = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_sidebar', true);
|
||||
$eb_room_similar = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_similar', true);
|
||||
$eb_room_description = get_post_meta( get_the_ID(), 'eagle_booking_mtb_room_description', true );
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Include room grid
|
||||
*/
|
||||
include eb_load_template('room-list.php');
|
||||
|
||||
?>
|
||||
|
||||
<?php endwhile; endif; ?>
|
||||
|
||||
<?php
|
||||
$result = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $result;
|
||||
}
|
||||
|
||||
add_shortcode('eagle-booking-rooms-list', 'eagle_rooms_list');
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/*---------------------------------------------------------------------------------
|
||||
ROOMS VC ELEMENT
|
||||
-----------------------------------------------------------------------------------*/
|
||||
if( !function_exists('eagle_rooms') ) {
|
||||
function eagle_rooms($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
|
||||
'branch_id' => '',
|
||||
'rooms_limit' => '',
|
||||
'rooms_per_row' => '',
|
||||
'offset' => '',
|
||||
'orderby' => '',
|
||||
'order' => '',
|
||||
|
||||
), $atts));
|
||||
|
||||
ob_start();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'eagle_rooms',
|
||||
'posts_per_page' => $rooms_limit,
|
||||
'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,
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
$rooms_qry = new WP_Query($args);
|
||||
|
||||
?>
|
||||
|
||||
<div class="row flex-row">
|
||||
<?php
|
||||
if ($rooms_qry->have_posts()): while ($rooms_qry->have_posts()): $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);
|
||||
|
||||
$col_class = '4';
|
||||
if ($rooms_per_row == '6') { $col_class = '2'; }
|
||||
if ($rooms_per_row == '4') { $col_class = '3'; }
|
||||
if ($rooms_per_row == '3') { $col_class = '4'; }
|
||||
if ($rooms_per_row == '2') { $col_class = '6'; }
|
||||
if ($rooms_per_row == '1') { $col_class = '12'; }
|
||||
?>
|
||||
<!-- Room Item -->
|
||||
<div class="col-lg-<?php echo esc_attr( $col_class ) ?> col-sm-6">
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Include room grid
|
||||
*/
|
||||
include eb_load_template('room-grid.php');
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
<?php endwhile; endif; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$result = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $result;
|
||||
}
|
||||
|
||||
add_shortcode('eagle-booking-rooms', 'eagle_rooms');
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user