I want to add a custom numeric field to product grid. This will appear as a column in product grid in admin backend, and the products in fronted can be sorted by this numeric field.
Is there an extension or an easy way doing it?
Better idea to create an product Attribute from Catalog>Manage Attribute
Put this attribute value to respect to each products
Using this attribute sort the product in admin
...
setDefaultSort()
of grid class of a module
is set grid order field in magento.
As you want the change current grid sort order of product then you need go Mage_Adminhtml_Block_Catalog_Product_Grid
.Here you see magento already set 'entity_id'
as default sort order. You need put your attribute code instead of 'entity_id'
Can use below an answer as an example