getIdByCode('catalog_product', 'created_at'); // Update database if($attribute_id) { $write = Mage::getSingleton('core/resource')->getConnection('core_write'); $sql = "UPDATE catalog_eav_attribute SET used_for_sort_by = 1 WHERE attribute_id = '$attribute_id' LIMIT 1"; $write->query($sql); echo 'Uninstalled!'; } else { echo 'Error!'; } ?>