🏨 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>
102 lines
2.7 KiB
PHP
102 lines
2.7 KiB
PHP
<?php
|
|
namespace Elementor\Modules\Promotions\Widgets;
|
|
|
|
use Elementor\Widget_Base;
|
|
use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit; // Exit if accessed directly.
|
|
}
|
|
|
|
class Pro_Widget_Promotion extends Widget_Base {
|
|
|
|
private $widget_data;
|
|
|
|
public function hide_on_search() {
|
|
return true;
|
|
}
|
|
|
|
public function show_in_panel() {
|
|
return false;
|
|
}
|
|
|
|
public function get_name() {
|
|
return $this->widget_data['widget_name'];
|
|
}
|
|
|
|
public function get_title() {
|
|
return $this->widget_data['widget_title'];
|
|
}
|
|
|
|
public function on_import( $element ) {
|
|
$element['settings']['__should_import'] = true;
|
|
|
|
return $element;
|
|
}
|
|
|
|
protected function register_controls() {}
|
|
|
|
protected function render() {
|
|
if ( $this->is_editor_render() ) {
|
|
$this->render_promotion();
|
|
} else {
|
|
$this->render_empty_content();
|
|
}
|
|
}
|
|
|
|
private function is_editor_render(): bool {
|
|
return \Elementor\Plugin::$instance->editor->is_edit_mode();
|
|
}
|
|
|
|
private function render_promotion() {
|
|
$promotion = Filtered_Promotions_Manager::get_filtered_promotion_data(
|
|
[
|
|
'image_url' => esc_url( $this->get_promotion_image_url() ),
|
|
'text' => sprintf(
|
|
esc_html__( 'This result includes the Elementor Pro %s widget. Upgrade now to unlock it and grow your web creation toolkit.', 'elementor' ),
|
|
esc_html( $this->widget_data['widget_title'] )
|
|
),
|
|
'upgrade_url' => esc_url( 'https://go.elementor.com/go-pro-element-pro/' ),
|
|
],
|
|
'elementor/pro-widget/promotion',
|
|
'upgrade_url'
|
|
);
|
|
?>
|
|
<div class="e-container">
|
|
<span class="e-badge"><i class="eicon-lock" aria-hidden="true"></i> <?php echo esc_html__( 'Pro', 'elementor' ); ?></span>
|
|
<p>
|
|
<img src="<?php echo esc_url( $promotion['image_url'] ); ?>" loading="lazy" alt="Go Pro">
|
|
<?php
|
|
echo esc_html( $promotion['text'] );
|
|
?>
|
|
</p>
|
|
<div class="e-actions">
|
|
<a href="#" class="e-btn e-btn-txt e-promotion-delete"><?php echo esc_html__( 'Remove', 'elementor' ); ?></a>
|
|
<a href="<?php echo esc_url( $promotion['upgrade_url'] ); ?>" rel="noreferrer" target="_blank" class="e-btn go-pro elementor-clickable e-promotion-go-pro"><?php echo esc_html__( 'Go Pro', 'elementor' ); ?></a>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
private function get_promotion_image_url(): string {
|
|
return ELEMENTOR_ASSETS_URL . 'images/go-pro.svg';
|
|
}
|
|
|
|
private function render_empty_content() {
|
|
echo ' ';
|
|
}
|
|
|
|
protected function content_template() {}
|
|
|
|
public function __construct( $data = [], $args = null ) {
|
|
$this->widget_data = [
|
|
'widget_name' => $args['widget_name'],
|
|
'widget_title' => $args['widget_title'],
|
|
];
|
|
|
|
parent::__construct( $data, $args );
|
|
}
|
|
|
|
public function render_plain_content( $instance = [] ) {}
|
|
}
|