title: Woocommerce getting custom field values in cart and checkout
body: <p>I am trying to get the <strong>custom field value of a WooCommerce product</strong> to display <strong>on different pages</strong> of the shop system. I succeeded to do so for the single product page, but the same code doesn't work for the cart.</p>
  
  <p>For the single product I used this code within the functions.php, which works fine:</p>
  
  <pre><code>global $post;
  echo '&lt;p&gt;' . get_post_meta($post-&gt;ID, 'my-custom-field', true) . '&lt;/p&gt;';
  </code></pre>
  
  <p>I tried the same code for the cart, but this time the values don't show on the page. I also referred to this thread (<a href="https://stackoverflow.com/questions/13374883/woocommerce-getting-custom-attributes">Woocommerce getting custom attributes</a>), changing $post to $product, but still no output...</p>
  
  <p>Any suggestions?</p>