Short answer... merge this with app/code/core/Mage/Sales/config.xml
or (better) add this to a config.xml
in your own local module. Modifying core files is frowned upon (but happens).
Change new_status
to your status.
<config>
<global>
<sales>
<order>
<statuses>
<new_status translate="label">
<label>New Status</label>
</new_status>
</statuses>
<states>
<new_status translate="label">
<label>New Status</label>
<statuses>
<new_status default="1"/>
</statuses>
<visible_on_front>1</visible_on_front>
</new_status>
</states>
</order>
</sales>
</global>
</config>
Long answer: See Mage_Sales_Block_Order_History
specifically, the piece that grabs the order collection
$orders = Mage::getResourceModel('sales/order_collection')
->addFieldToSelect('*')
->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())
->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
->setOrder('created_at', 'desc')
The second addFieldToFilter
looks for order states within a set of "visible" states. Those set of states are pulled by Mage_Sales_Order_Config
, and are set in the configuration. See above for the configuration changes. You can look in Mage_Sales_Order_Config
and the function _getStates()
to see how it pulls these from the configuration.