I don’t know about you, but I have had clients using WooCommerce to sell things other than physical products. For instance, one client is using it to sell tickets to events. In this case, having a tab named “Product Description” just isn’t quite…right. Additionally, the header within the box is often just redundant.

Here I provide you with code to make several different types of changes to this part of your WooCommerce installation. Each of these snippets would be placed within the functions.php file of your theme.

To just change the title of the tab to something specific for every instance of this tab, use this:

// Change the description tab title to Event Information
add_filter( 'woocommerce_product_tabs', 'wc_change_product_description_tab_title', 10, 1 );
function wc_change_product_description_tab_title( $tabs ) {
global $post;
if ( isset( $tabs['description']['title'] ) )
$tabs['description']['title'] = 'Event Information';
return $tabs;
}

To change the tab title to the title of the product itself (this would change with each product being viewed), use this:

post_title;
return $tabs;
}

You could also change the header title to reflect the product name. In that case, use this code:

// Change the description tab heading to product name
add_filter( 'woocommerce_product_description_heading', 'wc_change_product_description_tab_heading', 10, 1 );
function wc_change_product_description_tab_heading( $title ) {
global $post;
return $post->post_title;
}
?>

Another variation would be to set it as a consistent header throughout, but with different default text. Here’s how you would do that:

// Change the description tab heading to product name
add_filter( 'woocommerce_product_description_heading', 'wc_change_product_description_tab_heading', 10, 1 );
function wc_change_product_description_tab_heading( $title ) {
global $post;
return 'Event Details';
}
?>

Or if you want to remove the header altogether, try this:

// Change the description tab heading to something specific
add_filter('woocommerce_product_description_heading',
'isa_product_description_heading');

function isa_product_description_heading() {
    return '';
}

I hope these options are helpful to you. If you have any questions or suggestions, or if this has helped you, please comment below.

thePixelPixie.com - WordPress boutique

Subscribe and receive my FREE eBook


4 MISTAKES You’re Making on Your Website that are Costing You MONEY!

  • This field is for validation purposes and should be left unchanged.

The Author

Save

Like thePixelPixie on Facebook

Leave a Reply

Your email address will not be published.

Ready to chat about how ThePixelPixie can help?