如何仅为特定产品更改 Woocommerce 结帐页面中的文本“帐单详细信息”?
我努力了:
/* Change the Billing Details checkout label to Your Details: */
function wc_billing_field_strings( $translated_text, $text, $domain )
{
switch ( $translated_text ) {
case 'Billing Details' :
$translated_text = __( 'Your Details', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );
但它正在改变所有产品的文本……我怎么能为一种特定的产品做到这一点?