Change SKU to Code in woo

Hi,

When I built this site I used woocommerce to manage the furniture collection. You helped me to change the term “SKU” to display as “Code” instead. I have noticed recently that this has returned to being displayed as SKU. Could you please help me to change it back to code.

You can see what I am talking abut on this link;

Regards,

Pix.

Hey Pix,

Please try to add this in the functions.php file of the child theme:

// Translate Strings
add_filter( 'gettext', 'translate_x_strings', 20, 3 );

function translate_x_strings( $translated_text, $text, $domain ) {

        switch ( $translated_text ) {

            case 'SKU: ' :

                $translated_text = __( 'Code: ', '__x__' );
                break;

            case 'SKU:' :

                $translated_text = __( 'Code: ', '__x__' );
                break;
        }

    return $translated_text;
}

Hope this helps.

Thank you that worked perfectly :smiley:

You’re most welcome, Pix.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.