KistleDe
KistleDe

Reputation: 21

Change a specific text in Woocommerce cart page

I would like to replace the text "Price" to "Value" in the description row of the shopping cart table of woocommerce.

How can I do this?

Upvotes: 2

Views: 925

Answers (1)

LoicTheAztec
LoicTheAztec

Reputation: 253784

Try the following:

add_filter('gettext', 'change_price_text_in_cart_page', 105, 3 );
function change_price_text_in_cart_page( $translated, $text, $domain ) {
    if( is_cart() && $text == 'Price' ) {
        $translated = __('Value', $domain );
    }
    return $translated;
}

Code goes in function.php file of your active child theme (or active theme). Tested and works.

enter image description here

Upvotes: 2

Related Questions