title: Get Custom Field Value From Product Category in WooCommerce
body: <p>I am trying to get a custom field value of a category to display for each product.</p>
  
  <p>I am using the Advanced Custom Fields (ACF) plugin to create a new option called category_attributes within the woocommerce Product categories.</p>
  
  <p>I want to display the value for category_attributes for products that are in this category.</p>
  
  <p>Here is the function that I created.  Currently using "product_cat_22" to display the value from that product category, but it needs to pull in the category id for that product and display the category_attributes field for that category.</p>
  
  <pre><code>//Category Listing Hooks
  function add_category_info_below_title() {
  
  $custom_field = get_field('category_attributes', 'product_cat_22');
  
  echo '&lt;div class="subCatAtts"&gt;' . $custom_field . '&lt;/div&gt;';
  
  }
  add_action( 'woocommerce_after_subcategory_title', 'add_category_info_below_title' );
  </code></pre>
  
  <p>Here is the site where this can be viewed - <a href="http://mdev4.com/roura/one/" rel="nofollow">http://mdev4.com/roura/one/</a></p>
  
  <p>Capacity: 4,000-8,000 LBS is the correct value category_attributes for product category 22. </p>