title: Updating programmatically customer's billing information in WooCommerce
body: <p>I have a form where the user registers to an event, and if they want to they can update some of their billing information on the fly.</p>
  
  <p>I have a list of the informations they can update, for example</p>
  
  <pre><code> $inputs = array(
          'billing_city'          =&gt; 'City',
          'billing_postcode'      =&gt; 'Postcode',
          'billing_email'         =&gt;  'Email',
          'billing_phone'         =&gt;  'Phone',
      );
  </code></pre>
  
  <p>I then tried to use the <code>WC_Customer</code> class to update the changed information:</p>
  
  <pre><code>$customer = new WC_Customer( get_current_user_id() );
  foreach ($inputs as $key =&gt; $label ) {
       $method = 'set_'. $key;
       $customer-&gt;$method( $value );
  }
  </code></pre>
  
  <p>It would seem straight forward enough. However, the billing informations are not changed. </p>
  
  <p>What am I doing wrong? Is there some other function that is supposed to deal with this issue? </p>
  
  <p>Woocommerce documentation doesn't really explain much.</p>