title: how to direct woocommerce cart content to shop page?
body: <p>Hi im using this code from woocommerce to insert a cart content on my site. Does somebody know how i can modify this code so if it shows 0 on the cart it will direct me to the shop page instead of the cart page?</p>
  
  <pre><code>&lt;?php global $woocommerce; ?&gt;
  
  &lt;a class="cart-contents" href="&lt;?php echo $woocommerce-&gt;cart-&gt;get_cart_url(); ?&gt;" title="&lt;?php _e('View your shopping cart', 'woothemes'); ?&gt;"&gt;&lt;?php echo sprintf(_n('%d item', '%d items', $woocommerce-&gt;cart-&gt;cart_contents_count, 'woothemes'), $woocommerce-&gt;cart-&gt;cart_contents_count);?&gt; - &lt;?php echo $woocommerce-&gt;cart-&gt;get_cart_total(); ?&gt;&lt;/a&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php)
  add_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment');
  
  function woocommerce_header_add_to_cart_fragment( $fragments ) {
      global $woocommerce;
  
      ob_start();
  
      ?&gt;
      &lt;a class="cart-contents" href="&lt;?php echo $woocommerce-&gt;cart-&gt;get_cart_url(); ?&gt;" title="&lt;?php _e('View your shopping cart', 'woothemes'); ?&gt;"&gt;&lt;?php echo sprintf(_n('%d item', '%d items', $woocommerce-&gt;cart-&gt;cart_contents_count, 'woothemes'), $woocommerce-&gt;cart-&gt;cart_contents_count);?&gt; - &lt;?php echo $woocommerce-&gt;cart-&gt;get_cart_total(); ?&gt;&lt;/a&gt;
      &lt;?php
  
      $fragments['a.cart-contents'] = ob_get_clean();
  
      return $fragments;
  
  }
  </code></pre>