Support

Account

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

  • @websteem that’s pretty much the same code I gave you!

    Are you adding the code to your functions file?

    You can add code to the archive-product.php template, it won’t be the code supplied though as you asked to use the woocommerce hooks.

    If you want to add direct to the template, just use:

    	global $wp_query;
    
    	# get the query object
    	$category = $wp_query->get_queried_object();	
    	#get the cat ID
    	$category_ID  = $category->term_id;
    	
    	echo '<p>Can we see this? Is '.$category_ID.' the right ID for this category?</p>'; #remove after debug
    	
    	#get the field
    	$contenu_categorie = get_field( 'contenu_categorie', 'category_'.$category_ID );
    	#if we have data, show it
    	if( $contenu_categorie ){
    		echo $contenu_categorie;
    	}