title: How do I use wc() in woocommerce?
body: <p>I'm working on using the <code>wc()</code> function in woocommerce. <a href="http://docs.woothemes.com/wc-apidocs/function-WC.html" rel="noreferrer">The documentation</a> says it <code>Returns the main instance of WC to prevent the need to use globals.</code> </p>
  
  <p>I can't find any examples of the use of this and I would like to know how to use wc() to do some basic things. I understand that it returns the main woocommerce instance; and from that I can extract all the data I would need; but I don't know the syntax for correct use ... might it be something like?</p>
  
  <pre><code>$foo = WC();
  $bar = $foo-&gt;cart;
  echo $bar;
  </code></pre>
  
  <p>could someone please correct this.</p>
  
  <p>Also I am trying to understand what the advantages of doing it this way instead of globalizing variables.</p>