I want to display just wishlist count like wishlist (2) in top bar, how can I remove the word "items" or "item"

  • can you please upload your code here? – Rohan Hapani Aug 31 '17 at 9:12

you can remove it from

if you have no theme installed you can go to this and change the 1 item and %1 items.

vendor/magento/module-catalog/i18n/en_US.csv or

if you have a theme installed you can go to this location and do that.


| improve this answer | |
  • thanks! but if i change "%1 items" to "%1" in en_US.csv it will change every where it found "%1 items". is there any other way? – Waqar Aug 31 '17 at 10:15
  • @waqar this is not used at more places so I think it will not affect your site. I personally replaced it and didn't see changes.You can go ahead. – Riddhish Bhayani Aug 31 '17 at 10:26

You can also edit counter generated phrase.

Look at the file in:


on line 84 you will see:

protected function createCounter($count)
    if ($count > 1) {
        return __('%1 items', $count);
    } elseif ($count == 1) {
        return __('1 item');
    return null;

You only have to override that method in your custom module.

For more info on how to do that this, look the following:

How to override customerData folder's file in magento 2?

| improve this answer | |
  • 1
    Please correct the path in your answer. It's "CustomerData" folder. /vendor/magento/module-wishlist/CustomerData/Wishlist.php – Pratik Kamani Dec 21 '18 at 6:41

You can override the phtml: Theme_Root/Magento_Wishlist/templates/link.phtml

Instead this:

<span data-bind="text: wishlist().counter" class="counter qty"></span>

You can do this:

<span data-bind="text: wishlist().items.length" class="counter qty"></span>
| improve this answer | |
  • I'm wondering is it worked for you? For me its not working console generates error, but weird part is after reload page error disappear!! – anonymous Mar 14 at 19:40
  • Worked for me thanks. – Iftakharul Alam May 5 at 6:53
  • Thanks @David It's working. – Pradeep Thakur Jun 15 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.