MainWP Community

Display the product description on related products in WooCommerce

Display the product description on related products in WooCommerce on your child site.

Snippet Type

Execute on Child Sites

Snippet

add_action('woocommerce_shop_loop_item_title', 'description_after_related_product_title', 15 );
function description_after_related_product_title(){
    global $woocommerce_loop, $product;

    // Only for related products: Display product description
    if( isset($woocommerce_loop['name']) && 'related' === $woocommerce_loop['name'] ) {
        echo '<p class="description">' . $product->get_description() . '</p>';
    }
}
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.