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:
123
wp-content/plugins/eagle-booking/core/vc/testimonials/index.php
Normal file
123
wp-content/plugins/eagle-booking/core/vc/testimonials/index.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/*---------------------------------------------------------------------------------
|
||||
TESTIMONIALS GRID
|
||||
-----------------------------------------------------------------------------------*/
|
||||
add_action( 'vc_before_init', 'eagle_vc_testimonials' );
|
||||
function eagle_vc_testimonials() {
|
||||
|
||||
vc_map( array(
|
||||
"name" => esc_html__( "Testimonials", "eagle-booking" ),
|
||||
"description" => '',
|
||||
"base" => "eb-testimonials",
|
||||
'category' => esc_html__("Eagle Themes",'eagle-booking'),
|
||||
"class" => "",
|
||||
'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",
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"param_name" => "posts_limit",
|
||||
"type" => "textfield",
|
||||
"value" => "3",
|
||||
"heading" => esc_html__("Items:", "eagle-booking"),
|
||||
"description" => "",
|
||||
"save_always" => true,
|
||||
),
|
||||
array(
|
||||
"param_name" => "posts_per_row",
|
||||
"type" => "dropdown",
|
||||
"value" => array('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
|
||||
),
|
||||
|
||||
|
||||
)
|
||||
));
|
||||
|
||||
/*---------------------------------------------------------------------------------
|
||||
TESTIMONIALS CAROUSEL
|
||||
-----------------------------------------------------------------------------------*/
|
||||
vc_map( array(
|
||||
"name" => esc_html__( "Testimonials Carousel", "eagle-booking" ),
|
||||
"description" => '',
|
||||
"base" => "eb-testimonials-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",
|
||||
"params" => array(
|
||||
|
||||
array(
|
||||
"param_name" => "posts_limit",
|
||||
"type" => "textfield",
|
||||
"value" => "3",
|
||||
"heading" => esc_html__("Number of testimonials to show:", "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
|
||||
),
|
||||
|
||||
|
||||
)
|
||||
));
|
||||
|
||||
// INCLUDE TESTIMONIAL LAYOUT
|
||||
foreach ( glob ( plugin_dir_path( __FILE__ ) . "layout/*.php" ) as $file ){
|
||||
include_once $file;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/*---------------------------------------------------------------------------------
|
||||
TESTIMONIALS CAROUSEL
|
||||
-----------------------------------------------------------------------------------*/
|
||||
if( !function_exists('eagle_testimonials_carousel') ) {
|
||||
function eagle_testimonials_carousel($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
'posts_limit' => '',
|
||||
'posts_per_row' => '',
|
||||
'offset' => '',
|
||||
'orderby' => '',
|
||||
'order' => ''
|
||||
), $atts));
|
||||
|
||||
ob_start();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'eagle_reviews',
|
||||
'posts_per_page' => $posts_limit,
|
||||
'orderby' => $orderby,
|
||||
'order' => $order,
|
||||
'offset' => $offset
|
||||
);
|
||||
$testi_qry = new WP_Query($args);
|
||||
?>
|
||||
|
||||
<?php
|
||||
$token = wp_generate_password(5, false, false);
|
||||
?>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
$('#testimonial-carousel-<?php echo esc_attr( $token ); ?>').owlCarousel({
|
||||
loop: true,
|
||||
margin: 10,
|
||||
items: 1,
|
||||
nav: false,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- TESTIMONIAL SLIDE ITEM -->
|
||||
<div id="testimonial-carousel-<?php echo esc_attr( $token ); ?>" class="testimonials-slider owl-carousel">
|
||||
<?php
|
||||
if ($testi_qry->have_posts()): while ($testi_qry->have_posts()) : $testi_qry->the_post();
|
||||
$testimonial_title = get_the_title();
|
||||
$testimonial_quote = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_quote', true);
|
||||
$testimonial_name = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_author', true);
|
||||
$testimonial_location = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_author_location', true);
|
||||
$testimonial_avatar_file_id = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_image_id', true );
|
||||
$testimonial_avatar = wp_get_attachment_image_url( $testimonial_avatar_file_id);
|
||||
$testimonial_starnumber = get_post_meta( get_the_ID(), 'eagle_booking_mtb_review_rating', true );
|
||||
?>
|
||||
<div class="item">
|
||||
<?php if ( $testimonial_avatar ) : ?>
|
||||
<img src="<?php echo esc_url( $testimonial_avatar ) ?>" alt="<?php echo esc_html( $testimonial_name ) ?>" width="80">
|
||||
<?php endif ?>
|
||||
<div class="review_content">
|
||||
<p><?php echo esc_html( $testimonial_quote ) ?></p>
|
||||
<div class="review_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_author"><?php echo $testimonial_name ?> - <?php echo esc_html( $testimonial_location ) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endwhile; endif; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
</div>
|
||||
<?php
|
||||
$result = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
// Depracated Shortcode
|
||||
add_shortcode('zante-testimonials-carousel', 'eagle_testimonials_carousel');
|
||||
|
||||
// New Shortcode
|
||||
add_shortcode('eb-testimonials-carousel', 'eagle_testimonials_carousel');
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/*---------------------------------------------------------------------------------
|
||||
TESTIMONIALS GRID
|
||||
-----------------------------------------------------------------------------------*/
|
||||
if( !function_exists('eagle_testimonials') ) {
|
||||
function eagle_testimonials($atts, $content = null)
|
||||
{
|
||||
extract(shortcode_atts(array(
|
||||
'posts_limit' => '',
|
||||
'posts_per_row' => '',
|
||||
'offset' => '',
|
||||
'orderby' => '',
|
||||
'order' => '',
|
||||
), $atts));
|
||||
|
||||
ob_start();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'eagle_reviews',
|
||||
'posts_per_page' => $posts_limit,
|
||||
'orderby' => $orderby,
|
||||
'order' => $order,
|
||||
'offset' => $offset
|
||||
);
|
||||
$testi_qry = new WP_Query($args);
|
||||
?>
|
||||
|
||||
<div class="row flex-row">
|
||||
<?php
|
||||
if ($testi_qry->have_posts()): while ($testi_qry->have_posts()): $testi_qry->the_post();
|
||||
|
||||
$testimonial_title = get_the_title();
|
||||
$testimonial_quote = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_quote', true);
|
||||
$testimonial_name = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_author', true);
|
||||
$testimonial_location = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_author_location', true);
|
||||
$testimonial_avatar_file_id = get_post_meta(get_the_ID(), 'eagle_booking_mtb_review_image_id', true );
|
||||
$testimonial_avatar = wp_get_attachment_image_url( $testimonial_avatar_file_id);
|
||||
$testimonial_starnumber = get_post_meta( get_the_ID(), 'eagle_booking_mtb_review_rating', true );
|
||||
|
||||
$col_class = '4';
|
||||
if ($posts_per_row == '6') { $col_class = '2'; }
|
||||
if ($posts_per_row == '4') { $col_class = '3'; }
|
||||
if ($posts_per_row == '3') { $col_class = '4'; }
|
||||
if ($posts_per_row == '2') { $col_class = '6'; }
|
||||
?>
|
||||
<!-- TESTIMONIAL GRID ITEM -->
|
||||
<div class="col-lg-<?php echo esc_attr( $col_class ); ?> col-sm-6 ">
|
||||
<div class="testimonial-item">
|
||||
<div class="review">
|
||||
<h3><?php echo esc_html( $testimonial_title ) ?></h3>
|
||||
<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>
|
||||
<p><?php echo esc_html( $testimonial_quote ) ?></p>
|
||||
</div>
|
||||
<div class="author">
|
||||
<?php if ( $testimonial_avatar ) : ?>
|
||||
<img src="<?php echo esc_url( $testimonial_avatar ) ?>" alt="<?php echo esc_html( $testimonial_name ) ?>" width="80">
|
||||
<?php endif ?>
|
||||
<div class="author-info">
|
||||
<h5><?php echo esc_html( $testimonial_name ) ?></h5>
|
||||
<span class="author-loacation"><?php echo esc_html( $testimonial_location ) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endwhile; endif; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$result = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $result;
|
||||
}
|
||||
|
||||
// Depracated Shortcode
|
||||
add_shortcode('zante-testimonials', 'eagle_testimonials');
|
||||
|
||||
// New Shortcode
|
||||
add_shortcode('eb-testimonials', 'eagle_testimonials');
|
||||
|
||||
add_shortcode('eb_testimonials', 'eagle_testimonials');
|
||||
}
|
||||
Reference in New Issue
Block a user