/*
Theme Name: Hello Elementor Child
Theme URI: https://elementor.com/hello-theme/?utm_source=wp-themes&utm_campaign=theme-uri&utm_medium=wp-dash
Template: hello-elementor
Author: Elementor Team
Author URI: https://elementor.com/?utm_source=wp-themes&utm_campaign=author-uri&utm_medium=wp-dash
Description: Hello Elementor is a lightweight and minimalist WordPress theme that was built specifically to work seamlessly with the Elementor site builder plugin. The theme is free, open-source, and designed for users who want a flexible, easy-to-use, and customizable website. The theme, which is optimized for performance, provides a solid foundation for users to build their own unique designs using the Elementor drag-and-drop site builder. Its simplicity and flexibility make it a great choice for both beginners and experienced Web Creators.
Tags: accessibility-ready,flexible-header,custom-colors,custom-menu,custom-logo,featured-images,rtl-language-support,threaded-comments,translation-ready
Version: 3.4.1.1747301025
Updated: 2025-05-15 09:23:45

*/



// === MINI COMPARE BOX FROM STORE compare3 ===

// shortcode แสดงกล่อง mini (ใช้ listing ที่คุณทำสำหรับ compare)
function onedd_mini_compare3_box_html() {
    // แทน YOUR_MINI_LISTING_ID ด้วย ID จริงของ listing mini compare
    return do_shortcode('[jet_engine_listing grid="YOUR_MINI_LISTING_ID"]');
}
add_shortcode('onedd_mini_compare3_box', 'onedd_mini_compare3_box_html');

// AJAX callback: คืน HTML กล่อง mini
function onedd_reload_compare3_box() {
    echo do_shortcode('[onedd_mini_compare3_box]');
    wp_die();
}
add_action('wp_ajax_onedd_reload_compare3_box', 'onedd_reload_compare3_box');
add_action('wp_ajax_nopriv_onedd_reload_compare3_box', 'onedd_reload_compare3_box');


// enqueue JS
function onedd_enqueue_compare3_reload_script() {
    wp_enqueue_script(
        'onedd-compare3-reload',
        get_stylesheet_directory_uri() . '/js/onedd-compare3-reload.js',
        array('jquery'),
        '1.0',
        true
    );

    wp_localize_script('onedd-compare3-reload', 'oneddCompare3Ajax', array(
        'ajaxurl' => admin_url('admin-ajax.php'),
    ));
}
add_action('wp_enqueue_scripts', 'onedd_enqueue_compare3_reload_script');
