简体   繁体   中英

How to change the .cart-title of woocommerce title

I am setting up a website based on Wordpress and Woocommerce can you tell me how can I change the Shopping Item in woocommerce. I want the title to be just "Cart".

I've tried to change it with add_action, but without success, even got an error.

add_action('cart-title', 'change-cart-title', 10);
$message = __('Cart', 'woocommerce');
echo '<span class="cart-title">' . $message . '</span>';
}, 9);

How can I change the cart-title to just Cart?

You can use this to change cart page title

function wpa_change_my_basket_text( $translated_text, $text, $domain ){
if($translated_text == 'Cart:' )
    $translated_text = 'Basket:';
return $translated_text;
}
add_filter( 'gettext', 'wpa_change_my_basket_text', 10, 3 );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM