Home › Forums › General Issues › Product Category extra description › Reply To: Product Category extra description
Hello everybody
Here is the answer I received this morning (French time) of Said, from the official ACF support:
With the field’s Location rule set as Taxonomy is equal to product_cat, the field should appear on your individual product category edit page. With the code below added in functions.php, the field value displays just fine on the individual category archive in the frontend as shown in this recording: https://www.awesomescreenshot.com/video/5711245?key=aa4a06a3a6ab345566493738b7aad9d5
add_action( ‘woocommerce_after_main_content’, ‘extra_description’ );
function extra_description() {
global $wp_query;
$product_cat = $wp_query->get_queried_object();
$cat_ID = $product_cat->term_id;
$extra_info = get_field( ‘product_extra’, ‘category_’ . $cat_ID );
if( $extra_info ){
echo $extra_info;
}
}
So i will try it out and let you know how it goes.
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.