Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8076871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:21:17+00:00 2026-06-05T15:21:17+00:00

Does anyone know how to make entity_id visible on the frontend as a sortable

  • 0

Does anyone know how to make entity_id visible on the frontend as a sortable attribute? I went to manage attributes and I can’t add entity_id as an attribute as it says

“The attribute code ‘entity_id’ is reserved by system. Please try another attribute code”

So I tried to do a search in the whole database I had Magento on using the following SQL CMD:

select attribute_id from eav_attribute where attribute_code = 'updated_at';

and it returned zero results, I tried other attributes and those showed…

Does anyone know how I can add entity_id as an attribute, as I can’t even make it visible because I have no idea what the attribute_id # is even while searching the whole database for that value.

Here is the code I use to make a attribute visible on the admin section of magento:

UPDATE `catalog_eav_attribute` 
SET `is_visible` = '1' 
WHERE `catalog_eav_attribute`.`attribute_id` = 105;

I’ve tried searching high and low for days, and trying different variations – so stuck at this point, any help would be great.

I’m using Magento Enterprise 12.2 if that helps, but to be honest the DB is not much different than the community version the only differences are the added modules but when it comes to products it’s pretty much the same.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:21:18+00:00Added an answer on June 5, 2026 at 3:21 pm

    This is surprisingly nasty – I can’t see a way to do this simply in the DB, as entity_id isn’t a standard attribute (it’s really just a key field) and the core code repeats the same logic in three place (urgh).

    It’s also changed a lot since the older versions of Magento, so many of the tutorials and forum posts on this no longer apply.

    What you can do is add “entity_id” in as a new sorting option, similar to the way “Best Value” exists as a sorting option. In the following example I’ve labelled it “Newest”

    The usual caveats apply: You should do this in an extension (or at the least in /local/ overrides) but the three core file methods that need overriding in Community Edition 1.7 are:

    Mage_Adminhtml_Model_System_Config_Source_Catalog_ListSort

    public function toOptionArray()
    {
        $options = array();
        $options[] = array(//benz001
                'label' => Mage::helper('catalog')->__('Newest'),
                'value' => 'entity_id'
            );  //end benz001       
        $options[] = array(
            'label' => Mage::helper('catalog')->__('Best Value'),
            'value' => 'position'
        );
        foreach ($this->_getCatalogConfig()->getAttributesUsedForSortBy() as $attribute) {
            $options[] = array(
                'label' => Mage::helper('catalog')->__($attribute['frontend_label']),
                'value' => $attribute['attribute_code']
            );
        }
        return $options;
    }
    

    Then Mage_Catalog_Model_Category_Attribute_Source_Sortby

        /**
     * Retrieve All options
     *
     * @return array
     */
    public function getAllOptions()
    {
        if (is_null($this->_options)) {
            $this->_options = array(
            array(//benz001
                'label' => Mage::helper('catalog')->__('Newest'),
                'value' => 'entity_id'
            ),  //end benz001
            array(
                'label' => Mage::helper('catalog')->__('Best Value'),
                'value' => 'position'
            ));
            foreach ($this->_getCatalogConfig()->getAttributesUsedForSortBy() as $attribute) {
                $this->_options[] = array(
                    'label' => Mage::helper('catalog')->__($attribute['frontend_label']),
                    'value' => $attribute['attribute_code']
                );
            }
        }
        return $this->_options;
    }
    

    And then Mage_Catalog_Model_Config

        public function getAttributeUsedForSortByArray()
    {
        $options = array(
            'entity_id' => Mage::helper('catalog')->__('Newest'),   //benz001   
            'position'  => Mage::helper('catalog')->__('Position'),             
        );
        foreach ($this->getAttributesUsedForSortBy() as $attribute) {
            /* @var $attribute Mage_Eav_Model_Entity_Attribute_Abstract */
            $options[$attribute->getAttributeCode()] = $attribute->getStoreLabel();
        }
    
        return $options;
    }
    

    With those in place, flush the cache and refresh and you can then select to sort by Newest/entity_id in the config and on the category page and on the frontend.

    Note: even if you have caching turned off it’s still a good idea to flush the cache – parts of the admin are cached even when caching is disabled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know I can make min-height work with the latest browsers? I am
Does anyone know how you can make a cocoa sheet with rounded corners like
Does anyone know how to make a multiple select (see below HTML) sortable? Using
Hey guys, Does anyone know how to make the Text View transparent and add
Does anyone know how to make labels, or text, smoother? At the moment they
Does anyone know of a way to make an AIR app display over top
Does anyone know how Google Analytics exports their PDFs? They don't seem to make
Does anyone know how to make this code stop the knob from rotating past
Does anyone know how to make rspec follow a redirect (in a controller spec)?
Does anyone know how to make a live text highlighter in javascript/jquery? with most

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.