在 Woocommerce 的結(jié)帳頁(yè)面中,我嘗試更改“帳單詳細(xì)信息”和“運(yùn)送到其他地址?”的標(biāo)簽。到其他文本中,但是當(dāng)我輸入如下 2 個(gè)類(lèi)似的代碼時(shí),它只更改一次:“帳單詳細(xì)信息”確實(shí)更改為“您的帳單信息”,但“運(yùn)送到不同地址”卻沒(méi)有。請(qǐng)幫忙。//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;}關(guān)于如何更改購(gòu)物車(chē)和結(jié)帳頁(yè)面 Woocommerce 中所有標(biāo)簽文本的任何方法?
1 回答

哈士奇WWW
TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超6個(gè)贊
試試這個(gè)代碼。
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 );
- 1 回答
- 0 關(guān)注
- 147 瀏覽
添加回答
舉報(bào)
0/150
提交
取消