Adding Extra Content to WooCommerce Category Page

3d Animation

If you want to add extra content to a WooCommerce Category page in addition to the top description block. This code will display new ACF content below the products. Apologies I can’t remember where I found this originally. It uses ACF to generate the content and the content is added via this block of code which you need to add to your functions.php file in your child theme in WordPress.

Step 1. Create the additional content using ACF in WordPress
Step 2. Add the block below to your functions.php file
Step 3. Change the get field value to the field you want to add/display
Step 4. Job done!


// Add ACF in woocommerce

function action_woocommerce_after_shop_loop() {
 
$term_id = get_queried_object()->term_id;
 
$post_id = 'product_cat_'.$term_id;
 
$custom_field = get_field('name-of-field-you-want-to-add', $post_id); // My Advanced Custom Field Variable
 
echo $custom_field;
 
};

add_action( 'woocommerce_after_shop_loop', 'action_woocommerce_after_shop_loop', 10, 2 );