title: Accessing Shipping Rate object data in Woocommerce 3
body: <p>I want to get the possible shipping methods in Woocommerce. I can get to the Class WC_Shipping_Rate class but i don't know how to get 'deeper' and it's driving me crazy.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>$packages = WC()-&gt;shipping-&gt;get_packages();
  
  foreach ( $packages as $i =&gt; $package ) {
  
      foreach($package['rates'] as $value){
          echo '&lt;pre&gt;'.var_export($value, true).'&lt;/pre&gt;';
      }
  
  }
  </code></pre>
  
  <p>This piece of code prints this on my screen:</p>
  
  <pre><code>WC_Shipping_Rate::__set_state(array(
     'data' =&gt; 
    array (
      'id' =&gt; 'flat_rate:1',
      'method_id' =&gt; 'flat_rate',
      'instance_id' =&gt; 1,
      'label' =&gt; 'Per post',
      'cost' =&gt; '2.50',
      'taxes' =&gt; 
      array (
      ),
    ),
     'meta_data' =&gt; 
    array (
      'Items' =&gt; '1 Kip × 1',
    ),
  ))
  WC_Shipping_Rate::__set_state(array(
     'data' =&gt; 
    array (
      'id' =&gt; 'free_shipping:2',
      'method_id' =&gt; 'free_shipping',
      'instance_id' =&gt; 2,
      'label' =&gt; 'Download kaart',
      'cost' =&gt; '0.00',
      'taxes' =&gt; 
      array (
      ),
    ),
     'meta_data' =&gt; 
    array (
      'Items' =&gt; '1 Kip × 1',
    ),
  ))
  </code></pre>
  
  <p>My question is: How can i access the <code>data</code> array and then the <code>label</code> value? I know how to get the <code>label</code> value, but i cant 'reach' the <code>data</code>...</p>
  
  <p>I have tried to get it using methods, more arrays but the <code>WC_Shipping_Rate::__set_state(array(</code> is confusing me. Any help would be appriciated.</p>