Uname:Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64

Base Dir : /home/nobi37te/public_html

User : nobi37te


403WebShell
403Webshell
Server IP : 104.21.25.182  /  Your IP : 216.73.217.54
Web Server : Apache
System : Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User : nobi37te ( 1003)
PHP Version : 8.2.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/nobi37te/public_html/wp-content/plugins/myfatoorah-woocommerce/public/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/nobi37te/public_html/wp-content/plugins/myfatoorah-woocommerce/public/js/cities.js
(function ($) {
    $(document).ready(function () {

        //important to update the date if the city is change
        if ($('#billing_city').prop('type') === 'select-one') {
            bindSelectWoo("billing");
        }
        $('#billing_city').change(function () {
            $('body').trigger('update_checkout');
        });


        if ($('#shipping_city').prop('type') === 'select-one') {
            bindSelectWoo("shipping");
        }
        $('#shipping_city').change(function () {
            $('body').trigger('update_checkout');
        });



        //change countries
        $('#billing_country').change(function () {
            callAjax('billing', $(this).val());
        });
        $('#shipping_country').change(function () {
            callAjax('shipping', $(this).val());
        });


        //ajax
        function callAjax(addr, country) {
            var selector = '#' + addr + '_city';
            $(selector).val('');
            $.ajax({
                cache: false,
                type: "POST",
                url: ajax_object.ajax_url,
                data: {
                    action: 'check_cities_field',
                    country_code: country
                },
                success: function (response)
                {
                    var selParent = $(selector).parent();
                    selParent.html('');
                    if (response === 'input') {
                        selParent.append('<input type="text" class="input-text " name="' + addr + '_city" id="' + addr + '_city" placeholder="" value="" autocomplete="address-level2">');
                    } else {
                        selParent.append("<select id='" + addr + "_city' name='" + addr + "_city' />");
                        $(selector).html('<option value=""> ' + response + '</option>');
                        bindSelectWoo(addr);
                    }
                    $(selector).change(function () {
                        $('body').trigger('update_checkout');
                    });

                }
            });
        }

        function bindSelectWoo(selector) {
            $('#' + selector + '_city').selectWoo({
                ajax: {
                    url: ajax_object.ajax_url,
                    dataType: 'json',
//                    delay: 250,
                    data: function (params) {
                        return {
                            term: params.term, // search term
                            country_code: $('#' + selector + '_country').val(),
                            action: 'get_cities'
                        };
                    },
                    processResults: function (data, params) {
                        if (data.success === false) {

                            $('.woocommerce-notices-wrapper').last().html('<ul class="woocommerce-error"><li>' + data.error + '</li></ul>');
                            $([document.documentElement, document.body]).animate({
                                scrollTop: $('.woocommerce-notices-wrapper').first().offset().top
                            }, 2000);

                            return {
                                results: []
                            };
                        }
                        $('.woocommerce-notices-wrapper').last().html('');

                        var terms = [];
                        if (data) {
                            $.each(data, function (id, text) {
                                terms.push({id: id, text: text});
                            });
                        }
                        return {
                            results: terms
                        };
                    },
                    cache: true
                },
                escapeMarkup: function (markup) {
                    return markup;
                }//let our custom formatter work
                //,minimumInputLength: 3
            });
        }

    });
}
)(jQuery);

Youez - 2016 - github.com/yon3zu
LinuXploit