Menu-new
Close
< All Topics
Print

Change Product Description Tab and Titles in WooCommerce

Description & overview

Code rename description & overview

Paste the code in the child theme → function.php

				
					add_filter( 'woocommerce_product_tabs', 'misha_rename_description_tab' );
function misha_rename_description_tab( $tabs ) {
$tabs[ 'description' ][ 'title' ] = 'Overview';
return $tabs;
}
				
			

Just Description

Code just rename description

Paste the code in the child theme → function.php

				
					add_filter( 'woocommerce_product_description_tab_title', 'misha_rename_description_tab' );
function misha_rename_description_tab( $title ) {
$title = 'Overview';
return $title;
}
				
			

String Collection

Collection of  various strings for renaming

Paste the code in the child theme → function.php

				
					add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {

     $tabs['description']['title'] = __( 'Produktinfo' );		// Rename the description tab

	return $tabs;
	}

// Change "Add to Cart" > "Add to Bag" in Single Page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_single_page_add_to_cart_callback' ); 
function woocommerce_single_page_add_to_cart_callback() {
    return __( 'Lägg till', 'text-domain' ); 
}
//Change the billing details heading and the billing information tab label

function wc_billing_field_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Faktureringsadress' :
$translated_text = __( 'Kundinformation', 'woocommerce' );
break;
case 'Faktureringsdetaljer' :
$translated_text = __( 'Kunddetaljer', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );

// Alter WooCommerce View Cart Text
add_filter( 'gettext', function( $translated_text ) {
    if ( 'View cart' === $translated_text ) {
        $translated_text = 'Visa varukorg';
    }
    return $translated_text;
} );

				
			
Table of Contents