更改 Elementor 菜单购物车小部件中的文本

问题描述 投票:0回答:2

如何更改新 Elementor 菜单购物车小部件中“结帐”和“显示购物车”按钮中的“小计”一词和文本? 我想将它们翻译成我的语言(波兰语),但这些文本在我使用的 Loco 翻译小部件中不可见。可能 str_ireplace () 可以工作,但我无法正确使用它。链接到我的网站 - https://www.abreo.pl.

php wordpress function woocommerce elementor
2个回答
4
投票

问题解决了...

/*Change text strings */
function my_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
        case 'Subtotal' :
            $translated_text = __( 'Your text here', 'woocommerce' );
            break;
            case 'Checkout' :
            $translated_text = __( 'Your text here', 'woocommerce' );
            break;
            case 'Show Cart' :
            $translated_text = __( 'Your text here', 'woocommerce' );
            break;
    }
    return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );

0
投票

我想在总价后添加一个带有文本的复选框,我该怎么做

© www.soinside.com 2019 - 2024. All rights reserved.