I need to remove this item count text in my orders table at the my account page, because I don't need it:

The text at Gesamtsumme should be changed from:
234,35€ for 1 Artikel
to
234,35€
I've tried it with deleting it in the file but I want to do this via my functions.php because this is better I think.
The correct way to make it work for singular and plural item count, for all languages is (where $text is the untranslated string):
add_filter('ngettext', 'remove_item_count_from_my_account_orders', 105, 3 );
function remove_item_count_from_my_account_orders( $translated, $text, $domain ) {
switch ( $text ) {
case '%1$s for %2$s item' :
$translated = '%1$s';
break;
case '%1$s for %2$s items' :
$translated = '%1$s';
break;
}
return $translated;
}
Code goes in function.php file of your active child theme (or active theme). Tested and works.
This finaly made it:
add_filter('ngettext', 'rename_place_order_button' );
function rename_place_order_button( $translated, $text, $domain ) {
switch ( $translated ) {
case '%1$s für %2$s Artikel' :
$translated = __( '%1$s', 'woocommerce' );
break;
}
return $translated;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With