public function wp_ajax_generate_shipping_label()
 {
     $order = wc_get_order($_POST['order_id']);
     if ($order) {
         $order_label = new WC_Order_Shipping_Label($order);
         if ($order_label->generate_label()) {
             wp_send_json(true);
             wp_die();
         }
     }
     wp_send_json(false);
     wp_die();
 }
 public static function order_action_download_shipping_label($order)
 {
     $order_label = new WC_Order_Shipping_Label($order);
     $label_data = $order_label->shipping_label_data();
     header("Content-Type: application/octet-stream");
     header("Content-Disposition: attachment; filename=label.zpl");
     echo $label_data;
     exit;
 }