title: WooCommerce - Retrieving the correct data value for select box after submitting
body: <p>I am using Woocommerce and I have built a select box in the Admin Panel. I populate the information in the select box via a flat file. 
  Everything works fine (almost).</p>
  
  <p>The part I am stuck on is after I select the "choice" I want and the save I am getting the array <strong><code>$key</code></strong> position and not the actual <strong><code>$value</code></strong>. I'm close but I just can't put my finger on it.</p>
  
  <p>Update: Here is my full code:</p>
  
  <pre><code>function woo_add_custom_admin_product_tab() {
  ?&gt;
      &lt;li class="custom_tab"&gt;&lt;a href="#custom_tab_data"&gt;&lt;?php _e('Additional Information', 'woocommerce'); ?&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;?php
  }
  add_action( 'woocommerce_product_write_panel_tabs', 'woo_add_custom_admin_product_tab' );
  
  
  function woo_add_custom_admin_fields() {    
      global $woocommerce, $post;
  
      echo '&lt;div id="custom_tab_data" class="panel woocommerce_options_panel"&gt;';
      echo '&lt;div class="options_group"&gt;';
  
      // Select - Breed1
      if (file_exists ( plugin_dir_path(__FILE__) .'breed.txt')) {
          $breedData = file_get_contents ( plugin_dir_path(__FILE__) .'breed.txt');
          $breedArray = explode ("\n", $breedData);
      }
  
      woocommerce_wp_select(array(
          'id'      =&gt; '_select_breed1',
          'label'   =&gt; __( 'Select Primary Breed', 'woocommerce' ),
          'desc_tip'    =&gt; 'true',
          'description' =&gt; __( 'Select the primary breed of the pet.', 'woocommerce' ),
          'options' =&gt; $breedArray
      ) );
      echo '&lt;/div&gt;';
      echo '&lt;/div&gt;';
  }
  add_action( 'woocommerce_product_write_panels', 'woo_add_custom_admin_fields' );
  
  
  // Save Fields;
  function woo_add_custom_general_fields_save( $post_id ){
      // Text Field - Pet Name
      $woocommerce_text_field = $_POST['_pet_name'];
      if( !empty( $woocommerce_text_field ) )
         update_post_meta( $post_id, '_pet_name', esc_attr( $woocommerce_text_field ) );
  
      // Select Field - Breed
      $woocommerce_select = $_POST['_select_breed1'];
      if( !empty( $woocommerce_select ) )
          update_post_meta( $post_id, '_select_breed1', esc_attr( $woocommerce_select ) );
  }
  add_action( 'woocommerce_process_product_meta', 'woo_add_custom_general_fields_save' );
  </code></pre>
  
  <p>My breed.txt file contains 3 lines (items):</p>
  
  <pre class="lang-css prettyprint-override"><code>Please Select a breed...
  Abyssinian
  Affenpinscher
  </code></pre>
  
  <p>And the generated array looks like this:</p>
  
  <pre class="lang-css prettyprint-override"><code>Array ( 
      [0] =&gt; Please Select a breed... 
      [1] =&gt; Abyssinian 
      [2] =&gt; Affenpinscher 
  )
  </code></pre>
  
  <p>So when I select <strong><code>"Affenpinscher"</code></strong> for example, I get as value <strong><code>"2"</code></strong> instead of  <strong><code>"Affenpinscher"</code></strong> .</p>
  
  <p>What I am doing wrong? How can I solve this issue?</p>
  
  <p>Thanks</p>