public function select_customer_id()
        {
            if (isset($_GET['post_type']) && $_GET['post_type'] == 'shop_order' && isset($_GET['user_id']) && !empty($_GET['user_id'])) {
                $user_id = $_GET['user_id'];
                ob_start();
                $c_name = get_user_meta($user_id, 'user_firstname', true) . ' ' . get_user_meta($user_id, 'user_lastname', true) . ' (#' . $user_id . ' - ' . get_user_meta($user_id, 'user_email', true) . ')';
                ?>
          if( $().select2 ){
            jQuery("#customer_user").select2("data", {"id":"<?php 
                echo $user_id;
                ?>
","text":"<?php 
                echo $c_name;
                ?>
"});          
          }else{
            jQuery('#customer_user').append('<option selected="selected" value="<?php 
                echo $user_id;
                ?>
"><?php 
                echo $c_name;
                ?>
)</option>').val(<?php 
                echo $user_id;
                ?>
).trigger('chosen:updated');
          }


          <?php 
                $customer_details = new WC_Crm_Customer_Details($user_id, 0);
                $customer_details->init_address_fields();
                $__b_address = $customer_details->billing_fields;
                $__s_address = $customer_details->shipping_fields;
                $formatted_shipping_address = wp_kses($customer_details->get_formatted_shipping_address(), array("br" => array()));
                //$formatted_shipping_address = str_replace('<br />', '<br />\\', $formatted_shipping_address);
                $formatted_billing_address = wp_kses($customer_details->get_formatted_billing_address(), array("br" => array()));
                //$formatted_billing_address = str_replace('<br />', '<br />\\', $formatted_billing_address);
                foreach ($__b_address as $key => $field) {
                    ?>
             jQuery('#_billing_<?php 
                    echo $key;
                    ?>
').val( "<?php 
                    echo addslashes(get_user_meta($user_id, 'billing_' . $key, true));
                    ?>
" );
          <?php 
                }
                foreach ($__s_address as $key => $field) {
                    ?>
             jQuery('#_shipping_<?php 
                    echo $key;
                    ?>
').val( "<?php 
                    echo addslashes(get_user_meta($user_id, 'shipping_' . $key, true));
                    ?>
" );
          <?php 
                }
                ?>
            jQuery('.order_data_column_container .order_data_column').last().find('.address')
            .html("<?php 
                echo "<p><strong>" . __("Address", "woocommerce") . ":</strong>" . addslashes($formatted_shipping_address) . "</p>";
                ?>
");

            jQuery('.order_data_column_container .order_data_column').first().next().find('.address')
            .html("<?php 
                echo "<p><strong>" . __("Address", "woocommerce") . ":</strong>" . addslashes($formatted_billing_address) . "</p>";
                ?>
");
        <?php 
                $js_string = ob_get_contents();
                ob_end_clean();
                wc_enqueue_js($js_string);
            } else {
                if (isset($_GET['post_type']) && $_GET['post_type'] == 'shop_order' && isset($_GET['last_order_id']) && !empty($_GET['last_order_id'])) {
                    $last_order_id = $_GET['last_order_id'];
                    ob_start();
                    $customer_details = new WC_Crm_Customer_Details(0, $last_order_id);
                    $customer_details->init_address_fields();
                    $__b_address = $customer_details->billing_fields;
                    $__s_address = $customer_details->shipping_fields;
                    $formatted_shipping_address = wp_kses($customer_details->get_formatted_shipping_address(), array("br" => array()));
                    $formatted_shipping_address = str_replace('<br />', '<br />\\', $formatted_shipping_address);
                    $formatted_billing_address = wp_kses($customer_details->get_formatted_billing_address(), array("br" => array()));
                    $formatted_billing_address = str_replace('<br />', '<br />\\', $formatted_billing_address);
                    foreach ($__b_address as $key => $field) {
                        $name_var = 'billing_' . $key;
                        $field_val = $customer_details->order->{$name_var};
                        ?>
             jQuery('#_billing_<?php 
                        echo $key;
                        ?>
').val( "<?php 
                        echo addslashes($field_val);
                        ?>
" );
          <?php 
                    }
                    foreach ($__s_address as $key => $field) {
                        $name_var = 'shipping_' . $key;
                        $field_val = $customer_details->order->{$name_var};
                        ?>
            jQuery('#_shipping_<?php 
                        echo $key;
                        ?>
').val( "<?php 
                        echo addslashes($field_val);
                        ?>
" );
          <?php 
                    }
                    ?>
            jQuery('.order_data_column_container .order_data_column').last().find('.address')
            .html("<?php 
                    echo "<p><strong>" . __("Address", "woocommerce") . ":</strong>" . addslashes($formatted_shipping_address) . "</p>";
                    ?>
");

            jQuery('.order_data_column_container .order_data_column').first().next().find('.address')
            .html("<?php 
                    echo "<p><strong>" . __("Address", "woocommerce") . ":</strong>" . addslashes($formatted_billing_address) . "</p>";
                    ?>
");
        <?php 
                    $js_string = ob_get_contents();
                    ob_end_clean();
                    wc_enqueue_js($js_string);
                }
            }
        }