Reputation: 436
I have added 3 additional custom-fields in the prices section of woocommerce product edit pages settings. I would like to replace "Regular Price" by "List price" instead.
How can I change "Regular price" text label in Woocommerce admin product edit page settings? Is it possible?
Upvotes: 2
Views: 2938
Reputation: 254182
2020 Update optimization (works for admin new product and on WooCommerce 4+ too)
Using a custom function hooked in WordPress "gettext
" filter hook, you will be able to replace in admin product edit and new product pages (backend) the text "Regular price" by "List price":
add_filter('gettext', 'change_backend_product_regular_price', 100, 3 );
function change_backend_product_regular_price( $translated_text, $text, $domain ) {
global $pagenow, $post_type;
if ( is_admin() && in_array( $pagenow, ['post.php', 'post-new.php'] )
&& 'product' === $post_type && 'Regular price' === $text && 'woocommerce' === $domain )
{
$translated_text = __( 'List price', $domain );
}
return $translated_text;
}
Code goes in functions.php file of your active child theme (or active theme). Tested and works.
Upvotes: 3