Kategorier
WooCommerce WordPress

WooCommerce : Show all product category descriptions on a product page

Insert this into your functions.php

add_action('woocommerce_after_single_product_summary', 'urlundcom_add_term_descriptions_to_single_product', 10);
function urlundcom_add_term_descriptions_to_single_product() {
    global $product;
    $terms = get_the_terms($product->get_id(), 'product_cat');
    if (empty($terms)) {
        return;
    }
    
    $descriptions = [];
    foreach ($terms as $term) {
        if ($term->description !== '') {
            $descriptions[] = $term->description;
        }
    }

    printf('<ul class="term-descriptions"><li>%s</li></ul>', implode('</li><li>', $descriptions));
}