Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change SKU text label in woocommerce to Product Code
function translate_woocommerce($translation, $text, $domain) {
if ($domain == 'woocommerce') {
switch ($text) {
case 'SKU':
$translation = 'Product Code';
break;
case 'SKU:':
$translation = 'Product Code:';
break;
}
}
return $translation;
}
add_filter('gettext', 'translate_woocommerce', 10, 3);
@wizard247

This comment has been minimized.

Copy link

commented May 11, 2017

Thanks Danny - how would I need to adjust this to make this change for one particular category only? Not a PHP programmer but good at cut & paste! ;)

@orlandoaleman

This comment has been minimized.

Copy link

commented Nov 1, 2017

Thanks to share!

@Emanuele20

This comment has been minimized.

Copy link

commented Oct 25, 2018

hello!
where i have to add that code?
try in functions.php....but not work....
Thx

@elias1435

This comment has been minimized.

Copy link

commented Feb 19, 2019

its worked...!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.