亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Woocommerce - 更改 2 結帳標簽文本不起作用

Woocommerce - 更改 2 結帳標簽文本不起作用

PHP
素胚勾勒不出你 2021-10-08 21:22:17
在 Woocommerce 的結帳頁面中,我嘗試更改“帳單詳細信息”和“運送到其他地址?”的標簽。到其他文本中,但是當我輸入如下 2 個類似的代碼時,它只更改一次:“帳單詳細信息”確實更改為“您的帳單信息”,但“運送到不同地址”卻沒有。請幫忙。//Change the Billing Address checkout labelfunction wc_billing_field_strings( $translated_text, $text, $domain ) {    switch ( $translated_text ) {        case 'Billing details' :            $translated_text = __( 'Your billing info', 'woocommerce' );            break;    }    return $translated_text;}add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );function shipchange( $translated_text, $text, $domain ) {    switch ( $translated_text ) {        case 'Ship to a different address?' :            $translated_text = __( 'other shipping address?', 'woocommerce' );            break;    }    return $translated_text;}關于如何更改購物車和結帳頁面 Woocommerce 中所有標簽文本的任何方法?
查看完整描述

1 回答

?
哈士奇WWW

TA貢獻1799條經驗 獲得超6個贊

試試這個代碼。


function wc_billing_field_strings( $translated_text, $text, $domain ) {

    switch ( $translated_text ) {

        case 'Billing details' :

            $translated_text = __( 'Your billing info', 'woocommerce' );

            break;

        case 'Ship to a different address?' :

            $translated_text = __( 'other shipping address?', 'woocommerce' );

            break;

    }

    return $translated_text;

}

add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );


查看完整回答
反對 回復 2021-10-08
  • 1 回答
  • 0 關注
  • 146 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號