Support

Account

Home Forums General Issues Product Category extra description Reply To: Product Category extra description

  • You would need to do something like

    
    add_action('woocommerce_after_main_content', 'my_extra_description');
    function my_extra_description() {
      // get the WC product ID
      // Please note that this is a guess and that
      // you may need to get someone that know WC
      // if it does not work
      $product = wc_get_product();
      $id = $product->get_id();
      // get categories for product
      $cats = get_object_terms($id, 'product_cat');
      // loop over cats
      if ($cats) {
        foreach ($cats as $cat) {
          // get acf field from cat
          $value = get_field('extra_description', $cat);
        }
      }
    }