title: How to Add Advanced Custom Fields to a Product Variation
body: <p><a href="https://stackoverflow.com/questions/37264813/add-advanced-custom-fields-to-woocommerce-product-variation">Add Advanced Custom Fields to WooCommerce Product Variation</a></p>
  
  <p>Hello, we are having issues trying to add a unique ACF per each variable product. </p>
  
  <p>Our product: "Product A - Variable Product." This product has 4 different variations, and we would like to add unique ACF depending on that product variation.</p>
  
  <p>Within our custom fields tab I created a new custom field, field group, and label, I then selected; "Show this field group if post is equal to product_variation Product A - Variable Product." Doing so did NOT add the custom field to our products admin page. Previously we have used; "post type is equal to product" which works great, but can not be used in the variable product situation.</p>
  
  <hr>
  
  <p>More background:
  Currently, we are using ACF to aid in our WooCommerce Email customizer, and it is working great. The email is printing out ACF data in accordance to the product that is purchased (see code below).</p>
  
  <pre><code>&lt;?php
  $product_idMe = $item-&gt;get_product_id();
  $fields = get_field_objects($product_idMe);
  if( $fields )
  {
      foreach( $fields as $field_name =&gt; $field )
      {   
              echo $field['label']; 
              echo $field['value'];  
      }
  }
  ?&gt;
  </code></pre>
  
  <hr>
  
  <p>Goal: To add unique ACF to variable products, and print out the data into an email (like we are doing already doing, but now with the variable products unique ACF).</p>
  
  <p>Please let me know if you need any clarification, a client of ours is trying to launch their website with this feature working.
  -Thanks, Michael P.</p>