🏨 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>
103 lines
2.6 KiB
PHP
103 lines
2.6 KiB
PHP
<?php
|
|
/**
|
|
* Redux Search Extension Class
|
|
*
|
|
* @package Redux
|
|
* @author Dovy Paukstys (dovy)
|
|
* @class Redux_Extension_Search
|
|
* @version 3.4.5
|
|
*/
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
if ( ! class_exists( 'Redux_Extension_Search' ) ) {
|
|
|
|
/**
|
|
* Class Redux_Extension_Search
|
|
*/
|
|
class Redux_Extension_Search extends Redux_Extension_Abstract {
|
|
|
|
/**
|
|
* Extension version.
|
|
*
|
|
* @var string
|
|
*/
|
|
public static $version = '3.4.5';
|
|
|
|
/**
|
|
* Extension friendly name.
|
|
*
|
|
* @var string
|
|
*/
|
|
public $extension_name = 'Search';
|
|
|
|
/**
|
|
* Redux_Extension_Search constructor.
|
|
*
|
|
* @param object $redux ReduxFramework object pointer.
|
|
*/
|
|
public function __construct( $redux ) {
|
|
if ( false === $redux->args['search'] ) {
|
|
return;
|
|
}
|
|
|
|
parent::__construct( $redux, __FILE__ );
|
|
|
|
$this->add_field( 'search' );
|
|
|
|
// Allow users to extend if they want.
|
|
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
|
do_action( 'redux/search/' . $redux->args['opt_name'] . '/construct' );
|
|
|
|
if ( isset( $_GET['page'] ) && sanitize_text_field( wp_unslash( $_GET['page'] === $this->parent->args['page_slug'] ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
|
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ), 0 );
|
|
}
|
|
|
|
add_action( "redux/metaboxes/{$this->parent->args[ 'opt_name' ]}/enqueue", array( $this, 'enqueue' ), 10 );
|
|
}
|
|
|
|
/**
|
|
* Support file enqueue.
|
|
*/
|
|
public function enqueue() {
|
|
$min = Redux_Functions::is_min();
|
|
|
|
/**
|
|
* Redux search CSS
|
|
* filter 'redux/page/{opt_name}/enqueue/redux-extension-search-css'
|
|
*/
|
|
if ( $this->parent->args['dev_mode'] ) {
|
|
wp_enqueue_style(
|
|
'redux-extension-search',
|
|
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
|
apply_filters( "redux/search/{$this->parent->args[ 'opt_name' ]}/enqueue/redux-extension-search-css", $this->extension_url . 'redux-extension-search.css' ),
|
|
array(),
|
|
self::$version
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Redux search JS
|
|
* filter 'redux/page/{opt_name}/enqueue/redux-extension-search-js
|
|
*/
|
|
wp_enqueue_script(
|
|
'redux-extension-search',
|
|
// phpcs:ignore WordPress.NamingConventions.ValidHookName
|
|
apply_filters( "redux/search/{$this->parent->args[ 'opt_name' ]}/enqueue/redux-extension-search-js", $this->extension_url . 'redux-extension-search' . $min . '.js' ),
|
|
'',
|
|
self::$version,
|
|
true
|
|
);
|
|
|
|
// Values used by the javascript.
|
|
wp_localize_script(
|
|
'redux-extension-search',
|
|
'reduxSearch',
|
|
array(
|
|
'search' => esc_html__( 'Search for field(s)', 'redux-framework' ),
|
|
)
|
|
);
|
|
}
|
|
}
|
|
}
|