title: WooCommerce - check if attribute exists and then give variable attribute value
body: <p>I have created a new attribute for my woocommerce products with the slug 'short-title'. The idea being that I want to override the title on the shop pages with the short title. I have set up a loop with the following:</p>
  
  <pre><code>if (get_post_meta($product-&gt;id, 'short-code', true)) {
  $product_name =  (get_post_meta($product-&gt;id, 'short-code', true));
  } else {
  $product_name =  get_the_title();
  }
  echo '&lt;div class="product-below"&gt;&lt;h4 class="product-name"&gt;'.$product_name.'&lt;/h4&gt;'; 
  </code></pre>
  
  <p>But this is not overriding the title when I enter a value in the short title field for a product. I think I need a different function from get_post_meta</p>