Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 更改Elementor菜单购物车小部件中的文本_Php_Wordpress_Function_Woocommerce_Elementor - Fatal编程技术网

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

Php 更改Elementor菜单购物车小部件中的文本,php,wordpress,function,woocommerce,elementor,Php,Wordpress,Function,Woocommerce,Elementor,如何在新Elementor菜单购物车小部件中更改签出和显示购物车按钮中的文字小计和文本? 我想把它们翻译成我的波兰语,但这些文本在我使用的本地翻译小部件中是看不见的。也许stru_ireplace可以用,但我不能正确使用它。链接到我的网站-。问题已解决 /*Change text strings */ function my_text_strings( $translated_text, $text, $domain ) { switch ( $translated_text ) {

如何在新Elementor菜单购物车小部件中更改签出和显示购物车按钮中的文字小计和文本? 我想把它们翻译成我的波兰语,但这些文本在我使用的本地翻译小部件中是看不见的。也许stru_ireplace可以用,但我不能正确使用它。链接到我的网站-。

问题已解决

/*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 );
问题解决了

/*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 );

您需要检查如何编辑wordpress模板,并找到要编辑的确切文件。还有一些模板编辑教程的链接。谢谢你的评论穆罕默德,是的,我知道我需要编辑模板,我知道如何做到这一点。问题在于一个精确的函数会改变上面提到的小部件中的按钮和文本。你需要检查如何编辑wordpress模板,并找到要编辑的精确文件。还有一个指向一些模板编辑教程的链接。谢谢你的评论穆罕默德,是的,我知道我需要编辑模板,我知道如何做到这一点。问题在于一个确切的函数将更改所述小部件中的按钮和文本。请共享您为解决此问题而编辑的文件及其完整路径。我也有同样的问题,所以如果你能告诉我在哪里添加这段代码,那就好了:将这段代码添加到你的child-theme-functions.php文件中。如果您没有子主题,我强烈建议您创建它,否则,在主题更新后,您将丢失所做的所有更改。在这里,您可以阅读有关子主题的内容。请共享您为解决此问题而编辑的具有完整路径的文件。我也有同样的问题,所以如果你能告诉我在哪里添加这段代码,那就好了:将这段代码添加到你的child-theme-functions.php文件中。如果您没有子主题,我强烈建议您创建它,否则,在主题更新后,您将丢失所做的所有更改。在这里,您可以阅读有关儿童主题的内容。