title: woocommerce retriving category name as div class?
body: <p>ok I am trying to retrive the category name of a woocommerce product displayed in a wordpress loop and use it as the class for a li also inside the loop i've tried this: </p>
  
  <pre><code> &lt;div id="isocontent" class="products"&gt;
                  &lt;ul&gt;&lt;?php while (have_posts()) : the_post(); ?&gt;
  
  
                          &lt;li class="&lt;?php echo $product-&gt;get_categories(); ?&gt; box"&gt;
                              &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php echo the_post_thumbnail(); ?&gt;&lt;/a&gt;
                              &lt;p&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/p&gt;
                              &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;span href="&lt;?php the_permalink(); ?&gt; " class="amount price" data-original="&lt;?php echo get_woocommerce_currency(); ?&gt;&lt;?php echo $product-&gt;get_price(); ?&gt;" data-price="&lt;?php echo $product-&gt;get_price(); ?&gt;" title="Original price: &lt;?php echo $product-&gt;get_price(); ?&gt;"&gt;&lt;?php echo get_woocommerce_currency(); ?&gt;&lt;?php echo $product-&gt;get_price(); ?&gt;&lt;/span&gt;&lt;/a&gt;
                              &lt;a href="&lt;?php the_permalink(); ?&gt;?add-to-cart=&lt;?php echo $post-&gt;ID ?&gt;" class="pbutton"&gt;Add to Cart&lt;/a&gt;
                          &lt;/li&gt;
                      &lt;?php endwhile; ?&gt;
                  &lt;/ul&gt;
              &lt;/div&gt; 
  </code></pre>
  
  <p>this being the part i'm trying to retrive the class with: </p>
  
  <pre><code>&lt;li class="&lt;?php echo $product-&gt;get_categories(); ?&gt; box"&gt;
  </code></pre>
  
  <p>but it just outputs this: </p>
  
  <pre><code>&lt;li class="&amp;lt;a href=" http:="" localhost.no="" fanny="" kategori="" interior-sv="" "="" rel="tag"&gt;
  </code></pre>
  
  <p>which does retrieve the category but also screws with the markup  breaking the loop. 
  I've also tried this:</p>
  
  <p><code>&lt;li &lt;?php post_class('box'); ?&gt;</code> </p>
  
  <p>but because woocommerce uses taxonmys it retrives the tags but not the product category. 
  any help is much appriciated
  Kind regards 
  Chris</p>