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:
29
wp-content/plugins/eagle-booking/core/admin/cpt/coupons.php
Normal file
29
wp-content/plugins/eagle-booking/core/admin/cpt/coupons.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/* --------------------------------------------------------------------------
|
||||
* Coupons CPT
|
||||
* @since 1.0.5
|
||||
---------------------------------------------------------------------------*/
|
||||
function eagle_booking_create_post_type_coupons() {
|
||||
|
||||
register_post_type('eagle_coupons',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __('Coupons', 'eagle-booking'),
|
||||
'singular_name' => __('Coupons', 'eagle-booking'),
|
||||
'add_new' => __( 'Add New Coupon', 'eagle-booking'),
|
||||
'add_new_item' => __( 'Add New Coupon', 'eagle-booking'),
|
||||
'edit_item' => __( 'Edit Coupon', 'eagle-booking'),
|
||||
),
|
||||
'public' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => false,
|
||||
'show_in_nav_menus' => false,
|
||||
'has_archive' => false,
|
||||
'exclude_from_search' => true,
|
||||
'rewrite' => array('slug' => 'coupons' ),
|
||||
'menu_icon' => 'dashicons-forms',
|
||||
'supports' => array('title' )
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action('init', 'eagle_booking_create_post_type_coupons');
|
||||
14
wp-content/plugins/eagle-booking/core/admin/cpt/cpts.php
Normal file
14
wp-content/plugins/eagle-booking/core/admin/cpt/cpts.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/* --------------------------------------------------------------------------
|
||||
* Include all CPT required by EB
|
||||
* @since 1.2.9.1
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
require_once EB_PATH . '/core/admin/cpt/coupons.php';
|
||||
require_once EB_PATH . '/core/admin/cpt/exceptions.php';
|
||||
require_once EB_PATH . '/core/admin/cpt/places.php';
|
||||
require_once EB_PATH . '/core/admin/cpt/reviews.php';
|
||||
require_once EB_PATH . '/core/admin/cpt/rooms.php';
|
||||
require_once EB_PATH . '/core/admin/cpt/services.php';
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/* --------------------------------------------------------------------------
|
||||
* Exceptions CPT
|
||||
* @since 1.0.4
|
||||
---------------------------------------------------------------------------*/
|
||||
function eagle_booking_create_post_type_exceptions() {
|
||||
|
||||
register_post_type('eagle_exceptions',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __('Exceptions', 'eagle-booking'),
|
||||
'singular_name' => __('Exceptions', 'eagle-booking'),
|
||||
'add_new' => __( 'Add New Exception', 'eagle-booking'),
|
||||
'add_new_item' => __( 'Add New Exception', 'eagle-booking'),
|
||||
'edit_item' => __( 'Edit Exception', 'eagle-booking'),
|
||||
),
|
||||
'public' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => false,
|
||||
'show_in_nav_menus' => false,
|
||||
'has_archive' => false,
|
||||
'exclude_from_search' => true,
|
||||
'rewrite' => array('slug' => 'exceptions' ),
|
||||
'menu_icon' => 'dashicons-forms',
|
||||
'supports' => array('title' )
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action('init', 'eagle_booking_create_post_type_exceptions');
|
||||
61
wp-content/plugins/eagle-booking/core/admin/cpt/places.php
Normal file
61
wp-content/plugins/eagle-booking/core/admin/cpt/places.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/* --------------------------------------------------------------------------
|
||||
* Places CPT
|
||||
* @since 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
// REGISTER CPT PLACES
|
||||
if (!function_exists('eagle_create_post_type_places')) :
|
||||
function eagle_create_post_type_places() {
|
||||
register_post_type('eagle_places',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __('Places', 'eagle-booking'),
|
||||
'singular_name' => __('Places', 'eagle-booking'),
|
||||
'add_new' => __( 'Add New Item', 'eagle-booking' ),
|
||||
'add_new_item' => __( 'Add New Item', 'eagle-booking' ),
|
||||
),
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'show_in_menu' => false,
|
||||
'show_in_nav_menus' => true,
|
||||
'exclude_from_search' => true,
|
||||
'menu_icon' => 'dashicons-location',
|
||||
'rewrite' => array('slug' => eb_get_option('eagle_booking_places_slug')),
|
||||
'supports' => array('title', 'thumbnail', 'editor', 'page-attributes')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action('init', 'eagle_create_post_type_places');
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
// ADD CUSTOM ROWS TO DASHBOARD
|
||||
add_image_size( 'admin-list-thumb', 80, 80, false );
|
||||
|
||||
function eagle_places_dashboard_columns( $columns ) {
|
||||
$columns = array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'featured_thumb' => __('Thumbnail', 'eagle-booking'),
|
||||
'title' => __('Title', 'eagle-booking'),
|
||||
'date' => 'Date'
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
|
||||
function eagle_places_dashboard_columns_data( $column, $post_id ) {
|
||||
switch ( $column ) {
|
||||
case 'featured_thumb':
|
||||
echo '<a href="' . get_edit_post_link() . '">';
|
||||
echo the_post_thumbnail( 'admin-list-thumb' );
|
||||
echo '</a>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( function_exists( 'add_theme_support' ) ) {
|
||||
add_filter( 'manage_eagle_places_posts_columns' , 'eagle_places_dashboard_columns' );
|
||||
add_action( 'manage_eagle_places_posts_custom_column' , 'eagle_places_dashboard_columns_data', 10, 2 );
|
||||
}
|
||||
57
wp-content/plugins/eagle-booking/core/admin/cpt/reviews.php
Normal file
57
wp-content/plugins/eagle-booking/core/admin/cpt/reviews.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/* --------------------------------------------------------------------------
|
||||
* Reviews CPT
|
||||
* @since 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
function eagle_create_post_type_reviews() {
|
||||
register_post_type('eagle_reviews',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __('Reviews', 'eagle-booking'),
|
||||
'singular_name' => __('Reviews (Testimonials)', 'eagle-booking'),
|
||||
'add_new' => __( 'Add New Item', 'eagle-booking' ),
|
||||
'add_new_item' => __( 'Add New Item', 'eagle-booking' ),
|
||||
),
|
||||
'public' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => false,
|
||||
'show_in_nav_menus' => false,
|
||||
'has_archive' => true,
|
||||
'exclude_from_search' => true,
|
||||
'menu_icon' => 'dashicons-testimonial',
|
||||
'supports' => array('title', 'thumbnail')
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action('init', 'eagle_create_post_type_reviews');
|
||||
|
||||
/*---------------------------------------------------------------------------------
|
||||
CUSTOM DASHBOARD COLUMNS
|
||||
-----------------------------------------------------------------------------------*/
|
||||
function eagle_reviews_dashboard_columns( $columns ) {
|
||||
$columns = array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'title' => __('Title', 'eagle-booking'),
|
||||
'testimonial_quote' => __('Author Quote', 'eagle-booking'),
|
||||
'testimonial_author' => __('Author Name', 'eagle-booking'),
|
||||
'date' => __('Date', 'eagle-booking')
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
|
||||
function eagle_reviews_dashboard_columns_data( $column, $post_id ) {
|
||||
switch ( $column ) {
|
||||
case 'testimonial_quote':
|
||||
echo get_post_meta( get_the_ID(), 'eagle_booking_mtb_review_quote', true );
|
||||
break;
|
||||
|
||||
case 'testimonial_author':
|
||||
echo get_post_meta( get_the_ID(), 'eagle_booking_mtb_review_author', true );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( function_exists( 'add_theme_support' ) ) {
|
||||
add_filter( 'manage_eagle_reviews_posts_columns' , 'eagle_reviews_dashboard_columns' );
|
||||
add_action( 'manage_eagle_reviews_posts_custom_column' , 'eagle_reviews_dashboard_columns_data', 10, 2 );
|
||||
}
|
||||
92
wp-content/plugins/eagle-booking/core/admin/cpt/rooms.php
Normal file
92
wp-content/plugins/eagle-booking/core/admin/cpt/rooms.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/* --------------------------------------------------------------------------
|
||||
* Rooms CPT
|
||||
* @since 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
function eagle_booking_create_post_type_rooms() {
|
||||
|
||||
register_post_type('eagle_rooms',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __('Rooms', 'eagle-booking'),
|
||||
'singular_name' => __('Rooms', 'eagle-booking'),
|
||||
'add_new' => __( 'Add New Room', 'eagle-booking'),
|
||||
'add_new_item' => __( 'Add New Room', 'eagle-booking'),
|
||||
'edit_item' => __( 'Edit Room', 'eagle-booking'),
|
||||
),
|
||||
'public' => true,
|
||||
'has_archive' => true,
|
||||
'show_in_menu' => false,
|
||||
'show_in_nav_menus' => true,
|
||||
'exclude_from_search' => true,
|
||||
'show_in_admin_bar' => true,
|
||||
//'show_in_rest' => true,
|
||||
'rewrite' => array('slug' => eb_get_option('eagle_booking_rooms_slug')),
|
||||
'menu_icon' => 'dashicons-admin-multisite',
|
||||
'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' )
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action('init', 'eagle_booking_create_post_type_rooms');
|
||||
|
||||
|
||||
|
||||
// ADD CUSTOM ROWS TO DASHBOARD
|
||||
add_image_size( 'admin-list-thumb', 80, 80, false );
|
||||
|
||||
function eagle_rooms_dashboard_columns( $columns ) {
|
||||
$columns = array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'featured_thumb' => esc_html__('Thumbnail', 'eagle-booking'),
|
||||
'title' => esc_html__('Title', 'eagle-booking'),
|
||||
'price' => esc_html__('Price', 'eagle-booking'),
|
||||
'date' => esc_html__('Date', 'eagle-booking'),
|
||||
'taxonomy-eagle_branch' => esc_html__('Branch', 'eagle-booking')
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
|
||||
function eb_rooms_dashboard_columns_data( $column, $post_id ) {
|
||||
switch ( $column ) {
|
||||
|
||||
case 'featured_thumb':
|
||||
echo '<a href="' . get_edit_post_link() . '">';
|
||||
echo the_post_thumbnail( array(60, 60) );
|
||||
echo '</a>';
|
||||
break;
|
||||
|
||||
case 'price':
|
||||
|
||||
if ( eb_currency_position() === 'before' ) {
|
||||
|
||||
echo eb_currency().''.eagle_booking_room_min_price( $post_id );
|
||||
|
||||
} else {
|
||||
|
||||
echo eagle_booking_room_min_price( $post_id ).''.eb_currency();
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
if ( function_exists( 'add_theme_support' ) ) {
|
||||
add_filter( 'manage_eagle_rooms_posts_columns' , 'eagle_rooms_dashboard_columns' );
|
||||
add_action( 'manage_eagle_rooms_posts_custom_column' , 'eb_rooms_dashboard_columns_data', 10, 2 );
|
||||
}
|
||||
|
||||
|
||||
// Keep the admin menu open on editting eagle_rooms CPT
|
||||
function eb_keep_cpt_menu_open($parent_file) {
|
||||
|
||||
global $current_screen, $post_type;
|
||||
|
||||
if ( $post_type == 'eagle_rooms' ) $parent_file = 'eb_bookings';
|
||||
|
||||
return $parent_file;
|
||||
|
||||
}
|
||||
|
||||
add_action('parent_file', 'eb_keep_cpt_menu_open' );
|
||||
29
wp-content/plugins/eagle-booking/core/admin/cpt/services.php
Normal file
29
wp-content/plugins/eagle-booking/core/admin/cpt/services.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/* --------------------------------------------------------------------------
|
||||
* Services CPT
|
||||
* @since 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
function eagle_booking_create_post_type_services() {
|
||||
|
||||
register_post_type('eagle_services',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __('Services', 'eagle-booking'),
|
||||
'singular_name' => __('Services', 'eagle-booking'),
|
||||
'add_new' => __( 'Add New Service', 'eagle-booking'),
|
||||
'add_new_item' => __( 'Add New Service', 'eagle-booking'),
|
||||
'edit_item' => __( 'Edit Service', 'eagle-booking'),
|
||||
),
|
||||
'public' => false,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => false,
|
||||
'show_in_nav_menus' => false,
|
||||
'has_archive' => false,
|
||||
'exclude_from_search' => true,
|
||||
'rewrite' => array('slug' => 'services' ),
|
||||
'menu_icon' => 'dashicons-awards',
|
||||
'supports' => array('title' )
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action('init', 'eagle_booking_create_post_type_services');
|
||||
Reference in New Issue
Block a user