Skip to content

Instantly share code, notes, and snippets.

@caco26i
Created June 10, 2021 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caco26i/f0b30e3d48c4e6970cc910371a248eca to your computer and use it in GitHub Desktop.
Save caco26i/f0b30e3d48c4e6970cc910371a248eca to your computer and use it in GitHub Desktop.
translate "No products in the cart."
/*
functions.php code
*/
// Your code
function lar_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case "No products in the cart." :
$translated_text = __( "NO HAY PRODUCTOS EN EL CARRITO", "woocommerce" );
break;
}
return $translated_text;
}
add_filter( "gettext", "lar_text_strings", 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment