title: Add new shipping method to Woocommerce programmatically
body: <p>I'm trying to add a new shipping method to my Woocommerce suite.</p>
  
  <p>Basically I'm trying to apply two different Shipping rates to an order depending on their user role.  I'm using Flat Rate as one of them, but need a custom one made. </p>
  
  <p>I have tried the <a href="http://docs.woothemes.com/document/shipping-method-api/" rel="nofollow">the shipping api</a> to create a new class but nothing seems to shows up.</p>
  
  <pre><code>&lt;?php namespace MySite;
  
  use WC_Shipping_Method;
  
      function your_shipping_method_init() {
          if ( ! class_exists( 'CustomShipping' ) ) {
  
              class CustomShipping extends WC_Shipping_Method {
                  /**
                   * Constructor for your shipping class
                   *
                   * @access public
                   * @return void
                   */
                  public function __construct() {
                      $this-&gt;id                 = 'your_shipping_method'; // Id for your shipping method. Should be uunique.
                      $this-&gt;method_title       = __( 'Your Shipping Method' );  // Title shown in admin
                      $this-&gt;method_description = __( 'Description of your shipping method' ); // Description shown in admin
  
                      $this-&gt;enabled            = "yes"; // This can be added as an setting but for this example its forced enabled
                      $this-&gt;title              = "My Shipping Method"; // This can be added as an setting but for this example its forced.
  
                      $this-&gt;init();
                  }
  
                  function init() {
                      // Load the settings API
                      $this-&gt;init_form_fields(); // This is part of the settings API. Override the method to add your own settings
                      $this-&gt;init_settings(); // This is part of the settings API. Loads settings you previously init.
  
                      // Save settings in admin if you have any defined
                      add_action( 'woocommerce_update_options_shipping_' . $this-&gt;id, array( $this, 'process_admin_options' ) );
                  }
  
                  /**
                   * calculate_shipping function.
                   *
                   * @access public
                   * @param mixed $package
                   * @return void
                   */
                  public function calculate_shipping( $package ) {
                      $rate = array(
                          'id' =&gt; $this-&gt;id,
                          'label' =&gt; $this-&gt;title,
                          'cost' =&gt; '10.99',
                          'calc_tax' =&gt; 'per_item'
                      );
  
                      // Register the rate
                      $this-&gt;add_rate( $rate );
                  }
              }
      }
  
      add_action( 'woocommerce_shipping_init', 'your_shipping_method_init' );
  
      function add_your_shipping_method( $methods ) {
          $methods[] = 'CustomShipping';
          return $methods;
      }
  
      add_filter( 'woocommerce_shipping_methods', 'add_your_shipping_method' );
  }
  </code></pre>
  
  <p>I use Composer to load my classes.  </p>
  
  <p>Aren't I supposed to see the new option in the Woocommerce Shipping settings?  Any guidance appreciated.</p>
  
  <p>An alternative would be the intercept the session data and just change the shipping total and taxes there.  That doesn't seem to work however.  Where can I find more data on where the shipping info comes from; where and when it's called?</p>