title: Getting cart products link and image in shortcode in WooCommerce
body: <p>I have this code which lists the products added to cart via shortcode. However, these are only the titles. I need help in getting the products URL so the titles are hyperlinks to each product. Also, I would like to display the image of the product in front of the title. Thanks for your help and your time.</p>
  
  <p>Code I currently have:</p>
  
  <pre><code>// Add Shortcode [bag_products]
  function get_cart_products() {
  $cart = WC()-&gt;cart-&gt;get_cart();
   foreach( $cart as $cart_item ){
  $product = wc_get_product( $cart_item['product_id'] );
     $cart_items .= '&amp;ndash;&amp;nbsp;'.$cart_item['data']-&gt;get_title().'&lt;br&gt;';
   }
   return $cart_items;
  }
  add_shortcode( 'bag_products', 'get_cart_products' );
  </code></pre>