Skip to content

Instantly share code, notes, and snippets.

@cpaul007
Created May 26, 2022 03:05
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 cpaul007/6e00b96091216514ff8eb0bc2f7d661c to your computer and use it in GitHub Desktop.
Save cpaul007/6e00b96091216514ff8eb0bc2f7d661c to your computer and use it in GitHub Desktop.
Translate no products in cart text
<?php //* do not include this line
add_filter( 'gettext_woocommerce', 'ouwoo_translate_cart_text', 10, 3);
function ouwoo_translate_cart_text( $translated_text, $text, $domain ) {
switch( $translated_text ) {
case 'No products in the cart.' :
$translated_text = "Please add some products from our shop, so we can generate a quote for you.";
break;
}
return $translated_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment