更改“查看购物车"按钮的文本 [英] Change the text of 'View cart' button

查看:20
本文介绍了更改“查看购物车"按钮的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 woocommerce 插件,但我在如何更改查看购物车按钮的文本方面遇到了问题,希望有人可以帮助解决我的问题,这是 我的网站这是我想要更改的文本图像 图像 我该如何编辑它?感谢所有建议.

Iam using a woocommerce plugin but I got an problem on how to change the text of the view cart button hope there is a one who can help with my problem this is my site this is the image of the text that i want to change the image how can i edit it? all suggestion are appreciated.

推荐答案

将以下内容添加到您的 functions.php 文件中.

Add the following to your functions.php file.

/**
 * Change text strings
 *
 * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
 */
function my_text_strings( $translated_text, $text, $domain ) {
    switch ( strtolower( $translated_text ) ) {
        case 'View Cart' :
            $translated_text = __( 'View Shopping Cart', 'woocommerce' );
            break;
    }
    return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );

这会将查看购物车更改为查看购物车

This will change View Cart to View Shopping Cart

这篇关于更改“查看购物车"按钮的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆