How to change item items text from footer cart of Woo Product Table

Estimated reading: 1 minute 115 views

If you would like to change footer cart item or items text, you have to use following filter hook.
Hook: ngettext_woo-product-table

Same on pre tag

/**
* Replace your item and items text 
* for Footer Cart
*/
 add_filter('ngettext_woo-product-table','wpt_custom_item_text_change',10, 5);
 function wpt_custom_item_text_change( $translation, $single, $plural, $number, $domain ){
	if($single !== '%d item') return $translation;
	if($translation == '%d item'){
		return '%d iTEM'; //Replace with custom Text, But should have '%d' in your text obviously.
	}elseif($translation == '%d items'){
		return '%d iTEMSS'; //Replace with custom Text, But should have '%d' in your text obviously.
	}
	return $translation;
 }
Share this Doc

How to change item items text from footer cart of Woo Product Table

Or copy link

CONTENTS