Question

here am using Magento 2.3 here category displaying category with its ID, enter image description here

How to Hide or Remove these Ids. Can I get help? thank you in advance.

Was it helpful?

Solution

Go to

  1. vendor/magento/module-catalog/Block/Adminhtml/Category/Tree.php

  2. comment the code

    // $result .= ' (ID: ' . $node->getId() . ')';

on the line 422 at function buildNodeName($node)

public function buildNodeName($node)
{
    $result = $this->escapeHtml($node->getName());
    // $result .= ' (ID: ' . $node->getId() . ')';
    if ($this->_withProductCount) {
        $result .= ' (' . $node->getProductCount() . ')'; 
    }
    return $result;
} 

That would get your job done . Let me know if you face any problem .

Happy Coding :)

NOTE : The right approach would be to overwrite this function in own own module but that would be out of scope for this question for such little tweak.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top