woocommerce/assets/js/admin/network-orders.min.js

1 line
810 B
JavaScript

!function(e,o,r){if("undefined"!=typeof woocommerce_network_orders){var t=[],n=[],d=[],c=e(document.getElementById("network-orders-tbody")),a=o.template(e(document.getElementById("network-orders-row-template")).text());woocommerce_network_orders.sites.length&&(e.each(woocommerce_network_orders.sites,function(o,r){n[o]=e.Deferred(),d.push(e.ajax({url:woocommerce_network_orders.order_endpoint,data:{_wpnonce:woocommerce_network_orders.nonce,network_orders:!0,blog_id:r},type:"GET"}).success(function(e){var r;for(r in e)t.push(e[r]);n[o].resolve()}).fail(function(){n[o].resolve()}))}),n.length>0&&e.when.apply(e,n).done(function(){var e,o;t.sort(function(e,o){var r,t;return r=Date.parse(e.date_created_gmt),t=Date.parse(o.date_created_gmt),r===t?0:r<t?1:-1});for(e in t)o=t[e],c.append(a(o))}))}}(jQuery,_);