| Server IP : 172.67.162.67 / Your IP : 216.73.216.222 Web Server : Apache System : Linux vps42439 6.8.0-136-generic #136~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 3 16:29:11 UTC x86_64 User : dh_7hi3h9 ( 6349477) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/dh_7hi3h9/regalflower.com/wp-content/plugins/woocommerce-currency-switcher/js/ |
Upload File : |
"use strict";
function woocs_recalculate_all_orders_data() {
if (confirm('Sure? This operation could not be rollback!!')) {
jQuery('.woocs_recalculate_all_orders_curr_button').prop('href', 'javascript:void(0);');
var data_count = {
action: "woocs_all_order_ids"
};
jQuery('.woocs_ajax_preload').show();
jQuery.post(ajaxurl, data_count, function (ids) {
var orders = JSON.parse(ids);
if (orders.length) {
woocs_recalculate_all_orders_data_do(0, orders);
}
});
}
}
function woocs_recalculate_all_orders_data_do(start, orders) {
var count_orders = orders.length;
var step = 10;
var orders_ids = orders.slice(start, start + step);
jQuery.ajax({
method: "POST",
url: ajaxurl,
data: {
action: 'woocs_recalculate_orders_data',
order_ids: orders_ids
},
success: function (dat) {
if ((start + step) > count_orders) {
jQuery('.woocs_ajax_preload').hide();
alert("Done!");
window.location.reload();
} else {
woocs_recalculate_all_orders_data_do(start + step, orders)
}
},
error: function () {
alert("Something wrong!");
}
});
}