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:
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/**
|
||||
* Button Set Field.
|
||||
*
|
||||
* @package ReduxFramework/Fields
|
||||
* @author Dovy Paukstys & Kevin Provance (kprovance)
|
||||
* @version 4.0.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// Don't duplicate me!
|
||||
if ( ! class_exists( 'Redux_Button_Set', false ) ) {
|
||||
|
||||
/**
|
||||
* Main Redux_button_set class
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Redux_Button_Set extends Redux_Field {
|
||||
|
||||
/**
|
||||
* Set field defaults.
|
||||
*/
|
||||
public function set_defaults() {
|
||||
$defaults = array(
|
||||
'options' => array(),
|
||||
'multi' => false,
|
||||
);
|
||||
|
||||
$this->field = wp_parse_args( $this->field, $defaults );
|
||||
}
|
||||
|
||||
/**
|
||||
* Field Render Function.
|
||||
* Takes the vars and outputs the HTML for the field in the settings
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function render() {
|
||||
if ( ! empty( $this->field['data'] ) && empty( $this->field['options'] ) ) {
|
||||
if ( empty( $this->field['args'] ) ) {
|
||||
$this->field['args'] = array();
|
||||
}
|
||||
|
||||
$this->field['options'] = $this->parent->get_wordpress_data( $this->field['data'], $this->field['args'], $this->value );
|
||||
|
||||
if ( empty( $this->field['options'] ) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$is_multi = isset( $this->field['multi'] ) && true === (bool) $this->field['multi'];
|
||||
|
||||
$name = $this->field['name'] . $this->field['name_suffix'];
|
||||
|
||||
// multi => true renders the field multi-selectable (checkbox vs radio).
|
||||
echo '<div class="buttonset ui-buttonset">';
|
||||
|
||||
if ( $is_multi ) {
|
||||
$s = '';
|
||||
|
||||
if ( empty( $this->value ) ) {
|
||||
$s = $name;
|
||||
}
|
||||
|
||||
echo '<input type="hidden" data-name="' . esc_attr( $name ) . '" class="buttonset-empty" name="' . esc_attr( $s ) . '" value=""/>';
|
||||
|
||||
$name = $name . '[]';
|
||||
}
|
||||
|
||||
foreach ( $this->field['options'] as $k => $v ) {
|
||||
$selected = '';
|
||||
|
||||
if ( $is_multi ) {
|
||||
$post_value = '';
|
||||
$type = 'checkbox';
|
||||
|
||||
if ( ! empty( $this->value ) && ! is_array( $this->value ) ) {
|
||||
$this->value = array( $this->value );
|
||||
}
|
||||
|
||||
if ( is_array( $this->value ) && in_array( (string) $k, $this->value, true ) ) {
|
||||
$selected = 'checked="checked"';
|
||||
$post_value = $k;
|
||||
}
|
||||
} else {
|
||||
$type = 'radio';
|
||||
|
||||
if ( is_scalar( $this->value ) ) {
|
||||
$selected = checked( $this->value, $k, false );
|
||||
}
|
||||
}
|
||||
|
||||
$the_val = $k;
|
||||
$the_name = $name;
|
||||
$data_val = '';
|
||||
$multi_class = '';
|
||||
|
||||
if ( $is_multi ) {
|
||||
$the_val = '';
|
||||
$the_name = '';
|
||||
$data_val = ' data-val=' . $k;
|
||||
$hidden_name = $name;
|
||||
$multi_class = 'multi ';
|
||||
|
||||
if ( '' === $post_value ) {
|
||||
$hidden_name = '';
|
||||
}
|
||||
|
||||
echo '<input type="hidden" class="buttonset-check" id="' . esc_attr( $this->field['id'] ) . '-buttonset' . esc_attr( $k ) . '-hidden" name="' . esc_attr( $hidden_name ) . '" value="' . esc_attr( $post_value ) . '"/>';
|
||||
}
|
||||
|
||||
echo '<input' . esc_attr( $data_val ) . ' data-id="' . esc_attr( $this->field['id'] ) . '" type="' . esc_attr( $type ) . '" id="' . esc_attr( $this->field['id'] ) . '-buttonset' . esc_attr( $k ) . '" name="' . esc_attr( $the_name ) . '" class="buttonset-item ' . esc_attr( $multi_class ) . esc_attr( $this->field['class'] ) . '" value="' . esc_attr( $the_val ) . '" ' . esc_html( $selected ) . '/>';
|
||||
echo '<label for="' . esc_attr( $this->field['id'] ) . '-buttonset' . esc_attr( $k ) . '">' . esc_html( $v ) . '</label>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue Function.
|
||||
* If this field requires any scripts, or css define this function and register/enqueue the scripts/css
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function enqueue() {
|
||||
wp_enqueue_script(
|
||||
'redux-field-button-set',
|
||||
Redux_Core::$url . 'inc/fields/button_set/redux-button-set' . Redux_Functions::is_min() . '.js',
|
||||
array( 'jquery', 'jquery-ui-core', 'redux-js' ),
|
||||
$this->timestamp,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class_alias( 'Redux_Button_Set', 'ReduxFramework_Button_Set' );
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
_deprecated_file( 'field_button_set.php', '4.3', 'class-redux-button-set.php', 'This file has been renamed and is no longer used in Redux 4. Please change any references to it as it will be removed in future versions of Redux.' );
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
echo null;
|
||||
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Field Button Set (button_set)
|
||||
*/
|
||||
|
||||
/*global jQuery, redux, redux_change */
|
||||
|
||||
(function( $ ) {
|
||||
'use strict';
|
||||
|
||||
redux.field_objects = redux.field_objects || {};
|
||||
redux.field_objects.button_set = redux.field_objects.button_set || {};
|
||||
|
||||
redux.field_objects.button_set.init = function( selector ) {
|
||||
selector = $.redux.getSelector( selector, 'button_set' );
|
||||
|
||||
$( selector ).each(
|
||||
function() {
|
||||
var el = $( this );
|
||||
var parent = el;
|
||||
|
||||
if ( ! el.hasClass( 'redux-field-container' ) ) {
|
||||
parent = el.parents( '.redux-field-container:first' );
|
||||
}
|
||||
|
||||
if ( parent.is( ':hidden' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( parent.hasClass( 'redux-field-init' ) ) {
|
||||
parent.removeClass( 'redux-field-init' );
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
el.find( '.buttonset' ).each(
|
||||
function() {
|
||||
if ( $( this ).is( ':checkbox' ) ) {
|
||||
$( this ).find( '.buttonset-item' ).button();
|
||||
}
|
||||
|
||||
$( this ).controlgroup();
|
||||
}
|
||||
);
|
||||
|
||||
el.find( '.buttonset-item.multi' ).on(
|
||||
'click',
|
||||
function() {
|
||||
var val = '';
|
||||
var name = '';
|
||||
var id = $( this ).attr( 'id' );
|
||||
var empty = $( this ).parent().find( '.buttonset-empty' );
|
||||
var idName = empty.attr( 'data-name' );
|
||||
var isChecked = false;
|
||||
|
||||
$( this ).parent().find( '.buttonset-item' ).each(
|
||||
function() {
|
||||
if ( $( this ).is( ':checked' ) ) {
|
||||
isChecked = true;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if ( isChecked ) {
|
||||
empty.attr( 'name', '' );
|
||||
} else {
|
||||
empty.attr( 'name', idName );
|
||||
}
|
||||
|
||||
if ( $( this ).is( ':checked' ) ) {
|
||||
val = $( this ).attr( 'data-val' );
|
||||
name = idName + '[]';
|
||||
|
||||
}
|
||||
|
||||
$( this ).parent().find( '#' + id + '-hidden.buttonset-check' ).val( val );
|
||||
$( this ).parent().find( '#' + id + '-hidden.buttonset-check' ).attr( 'name', name );
|
||||
|
||||
redux_change( $( this ) );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
};
|
||||
})( jQuery );
|
||||
1
wp-content/plugins/eagle-booking/include/redux/inc/fields/button_set/redux-button-set.min.js
vendored
Normal file
1
wp-content/plugins/eagle-booking/include/redux/inc/fields/button_set/redux-button-set.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.button_set=redux.field_objects.button_set||{},redux.field_objects.button_set.init=function(t){t=a.redux.getSelector(t,"button_set"),a(t).each(function(){var t=a(this),e=t;(e=t.hasClass("redux-field-container")?e:t.parents(".redux-field-container:first")).is(":hidden")||e.hasClass("redux-field-init")&&(e.removeClass("redux-field-init"),t.find(".buttonset").each(function(){a(this).is(":checkbox")&&a(this).find(".buttonset-item").button(),a(this).controlgroup()}),t.find(".buttonset-item.multi").on("click",function(){var t="",e="",i=a(this).attr("id"),n=a(this).parent().find(".buttonset-empty"),s=n.attr("data-name"),d=!1;a(this).parent().find(".buttonset-item").each(function(){a(this).is(":checked")&&(d=!0)}),d?n.attr("name",""):n.attr("name",s),a(this).is(":checked")&&(t=a(this).attr("data-val"),e=s+"[]"),a(this).parent().find("#"+i+"-hidden.buttonset-check").val(t),a(this).parent().find("#"+i+"-hidden.buttonset-check").attr("name",e),redux_change(a(this))}))})}}(jQuery);
|
||||
Reference in New Issue
Block a user