Woo: Change the No Product in cart text on the Oxy Ultimate Woo plugin

This is a snippet for Oxy Ultimate Woo plugin that allows you to change the default “No product in cart” to anything you like.

Credit to the Developer, you can see the original code here

<?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 = "ENTER YOUR TEXT HERE";
      break;
  }
  return $translated_text;
}

// newsletter

Three tested WordPress snippets a week

Blocks, security, performance, Tailwind, PHP and React. Copy, paste, ship. You’ll also get DPlugins product updates. No spam, and you can unsubscribe anytime.

// newsletter

Three tested WordPress snippets a week

Blocks, security, performance, Tailwind, PHP and React. Copy, paste, ship. You'll also get DPlugins product updates. No spam, and you can unsubscribe anytime.

Click to Copy