title: How to acces value of ACF field located in a product category in wp admin, from a single product belonging to that category?
body: <p>Appreciate all the guidance I can get on this one.</p>
  <p>I am working on a shop using WordPress and Woocommerce.
  I have a custom order form that I want to display on each product in a specific product category. My idea is to use an ACF field with true/false checkbox to determine whether the products in this category should have an order form or not.</p>
  <p>The checkbox is located here:</p>
  <p><a href="https://i.stack.imgur.com/2DQ7y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2DQ7y.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/sWY01.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sWY01.png" alt="enter image description here" /></a></p>
  <p>So I don't want to name a specific product category in my code, instead I want to check if a single product belongs to a category which has a checked checkbox for the order form.</p>
  <p>My issue is that I don't understand how to display the order form in a products post when checking the box, without the need to add it in all posts that should display it. Is it possible to access my ACF from a single product when it is added in the taxonomy product_cat? Any ideas?</p>
  <p>I found the get_the_terms function but I am not sure how to use it.
  This is how I've been trying to access my ACF:</p>
  <pre><code>function test() {
   global $post;
   $terms = get_the_terms( $post-&gt;ID, 'product_cat' );
   $queried_object = get_queried_object(); 
   $taxonomy = $queried_object-&gt;taxonomy;
   $term_id = $queried_object-&gt;term_id;  
  
   $checked_form = get_field('orderform', $taxonomy . '_' . $term_id);
   if($checked_form) {
        echo 'Checked!';
   }else{
        echo 'Not checked';
        var_dump($terms);
        var_dump($checked_form);
        var_dump($term_id);
   }
  }
  add_action('woocommerce_single_product_summary', 'test');
  </code></pre>