Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save codersaiful/3dd54d67ec0f0db9eb7a1ca5144bf5c9 to your computer and use it in GitHub Desktop.
Save codersaiful/3dd54d67ec0f0db9eb7a1ca5144bf5c9 to your computer and use it in GitHub Desktop.
<?php
/**
* 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;
switch ($translation) {
case '%d item':
return '%d iTEM'; // Replace with custom text, ensuring '%d' is present.
case '%d items':
return '%d iTEMSS'; // Replace with custom text, ensuring '%d' is present.
default:
return $translation;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment