Change any text string in WooCommerce

You can easily change any text string appearing in WooCommerce with this code. This example changes the text on the empty cart page from “Return to shop” to “Return to product listing”

		/**
 * Change any text string in WooCommerce
 */

add_filter('gettext', 'cc_change_text_string');
add_filter('ngettext', 'cc_change_text_string');

function cc_change_text_string($changed_text) {

  $changed_text = str_ireplace('Return to shop',  'Return to product listing',  $changed_text);
  return $changed_text;

}
	
View Raw Code ID: 9952