Hotel Raxa Dev 5b1e2453c7 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>
2025-07-11 07:43:22 +02:00

102 lines
2.5 KiB
PHP

<?php
namespace Elementor\Modules\SiteNavigation\Data\Endpoints;
use Elementor\Core\Base\Document;
use Elementor\Core\Kits\Documents\Kit;
use Elementor\Data\V2\Base\Endpoint;
use Elementor\Plugin;
use Elementor\TemplateLibrary\Source_Local;
use Elementor\Utils;
use WP_REST_Server;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
class Recent_Posts extends Endpoint {
public function register_items_route( $methods = WP_REST_Server::READABLE, $args = [] ) {
$args = [
'posts_per_page' => [
'description' => 'Number of posts to return',
'type' => 'integer',
'required' => true,
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
],
'post_type' => [
'description' => 'Post types to retrieve',
'type' => 'array',
'required' => false,
'default' => [ 'page', 'post', Source_Local::CPT ],
'sanitize_callback' => 'rest_sanitize_array',
'validate_callback' => 'rest_validate_request_arg',
],
'post__not_in' => [
'description' => 'Post id`s to exclude',
'type' => 'array',
'required' => [],
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
],
];
parent::register_items_route( $methods, $args );
}
public function get_name() {
return 'recent-posts';
}
public function get_format() {
return 'site-navigation/recent-posts';
}
public function get_items( $request ) {
$args = [
'posts_per_page' => $request->get_param( 'posts_per_page' ),
'post_type' => $request->get_param( 'post_type' ),
'fields' => 'ids',
'meta_query' => [
[
'key' => Document::TYPE_META_KEY,
'value' => Kit::get_type(), // Exclude kits.
'compare' => '!=',
],
],
];
$exclude = $request->get_param( 'post__not_in' );
if ( ! empty( $exclude ) ) {
$args['post__not_in'] = $exclude;
}
$recently_edited_query = Utils::get_recently_edited_posts_query( $args );
$recent = [];
foreach ( $recently_edited_query->posts as $id ) {
$document = Plugin::$instance->documents->get( $id );
$recent[] = [
'id' => $id,
'title' => get_the_title( $id ),
'edit_url' => $document->get_edit_url(),
'date_modified' => get_post_timestamp( $id, 'modified' ),
'type' => [
'post_type' => get_post_type( $id ),
'doc_type' => $document->get_name(),
'label' => $document->get_title(),
],
'user_can' => [
'edit' => current_user_can( 'edit_post', $id ),
],
];
}
return $recent;
}
}