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);
}
}
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.