🏨 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>
148 lines
3.2 KiB
JavaScript
148 lines
3.2 KiB
JavaScript
/* global reduxMetaboxes */
|
|
|
|
jQuery(
|
|
function ( $ ) {
|
|
'use strict';
|
|
|
|
var isGutenberg = false;
|
|
|
|
$.reduxMetaBoxes = $.reduxMetaBoxes || {};
|
|
|
|
$( document ).ready(
|
|
function () {
|
|
$.reduxMetaBoxes.init();
|
|
|
|
if ( $( 'body' ).hasClass( 'block-editor-page' ) ) {
|
|
isGutenberg = true;
|
|
}
|
|
}
|
|
);
|
|
|
|
setTimeout(
|
|
function () {
|
|
if ( true === isGutenberg ) {
|
|
$( '.postbox .toggle-indicator' ).removeClass( 'toggle-indicator' ).addClass( 'el' );
|
|
}
|
|
|
|
$( '#publishing-action .button, #save-action .button, .editor-post-publish-button' ).on(
|
|
'click',
|
|
function () {
|
|
$( '.redux-save-warn' ).slideUp();
|
|
|
|
window.onbeforeunload = null;
|
|
}
|
|
);
|
|
},
|
|
1000
|
|
);
|
|
|
|
$.reduxMetaBoxes.init = function () {
|
|
$.reduxMetaBoxes.notLoaded = true;
|
|
|
|
$.redux.initFields();
|
|
|
|
if ( $( 'body' ).hasClass( 'block-editor-page' ) ) {
|
|
isGutenberg = true;
|
|
}
|
|
|
|
if ( isGutenberg ) {
|
|
setTimeout(
|
|
function () {
|
|
$.reduxMetaBoxes.checkBoxVisibility();
|
|
|
|
$( '.editor-post-format__content select, .editor-post-format select' ).on(
|
|
'change',
|
|
function () {
|
|
$.reduxMetaBoxes.checkBoxVisibility( 'post_format' );
|
|
}
|
|
);
|
|
|
|
$( '.edit-post-post-template__toggle' ).on(
|
|
'click',
|
|
function () {
|
|
setTimeout(
|
|
function () {
|
|
$( '.components-popover .components-select-control__input' ).on(
|
|
'change',
|
|
function () {
|
|
$.reduxMetaBoxes.checkBoxVisibility( 'page_template' );
|
|
}
|
|
);
|
|
},
|
|
1000
|
|
);
|
|
}
|
|
);
|
|
},
|
|
1000
|
|
);
|
|
} else {
|
|
$.reduxMetaBoxes.checkBoxVisibility();
|
|
|
|
$( '#page_template' ).on(
|
|
'change',
|
|
function () {
|
|
$.reduxMetaBoxes.checkBoxVisibility( 'page_template' );
|
|
}
|
|
);
|
|
|
|
$( 'input[name="post_format"]:radio' ).on(
|
|
'change',
|
|
function () {
|
|
$.reduxMetaBoxes.checkBoxVisibility( 'post_format' );
|
|
}
|
|
);
|
|
}
|
|
};
|
|
|
|
$.reduxMetaBoxes.checkBoxVisibility = function ( fieldID ) {
|
|
if ( 0 !== reduxMetaboxes.length ) {
|
|
$.each(
|
|
reduxMetaboxes,
|
|
function ( box, values ) {
|
|
$.each(
|
|
values,
|
|
function ( field, v ) {
|
|
var visible = false;
|
|
var testValue;
|
|
|
|
if ( field === fieldID || ! fieldID ) {
|
|
if ( 'post_format' === field ) {
|
|
if ( isGutenberg ) {
|
|
testValue = $( '.editor-post-format__content select option:selected, .editor-post-format select option:Selected' ).val();
|
|
} else {
|
|
testValue = $( 'input:radio[name="post_format"]:checked' ).val();
|
|
}
|
|
} else {
|
|
testValue = $( '#' + field ).val();
|
|
}
|
|
|
|
if ( testValue ) {
|
|
$.each(
|
|
v,
|
|
function ( key, val ) {
|
|
if ( val === testValue ) {
|
|
visible = true;
|
|
}
|
|
}
|
|
);
|
|
|
|
if ( ! visible && ! $.reduxMetaBoxes.notLoaded ) {
|
|
$( '#' + box ).hide();
|
|
} else if ( ! visible ) {
|
|
$( '#' + box ).hide();
|
|
} else {
|
|
$( '#' + box ).fadeIn( '300' );
|
|
$.redux.initFields();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
);
|
|
}
|
|
);
|
|
}
|
|
};
|
|
}
|
|
);
|