Skip to content

Instantly share code, notes, and snippets.

@dannyconnolly
Created December 18, 2015 13:22
  • Star 13 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dannyconnolly/da6f1a2d95dc826ccdcd to your computer and use it in GitHub Desktop.
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
Copy link

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
Copy link

orlandoaleman commented Nov 1, 2017

Thanks to share!

@Emanuele20
Copy link

Emanuele20 commented Oct 25, 2018

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

@elias1435
Copy link

its worked...!

@dragonlord4747
Copy link

Yeahhhh! Thankss. Its worked...!!!!

@Erraoudy
Copy link

thank you bro

@ARJ-HADES
Copy link

not working showing an
Screenshot 2021-10-12 151159
error

@jolution
Copy link

jolution commented Dec 3, 2021

@ARJ-HADES Your error could also be due to write and / or access rights. Can you generally write something in and save in it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment