I created a custom order status like below.(This is a big issue that i am simply missing some small stuff and hope to figure out with the help of a member).
config.xml
<sales>
<order>
<statuses>
<backorders translate="label">
<label>Back Orders</label>
</backorders>
</statuses>
<states>
<backorders translate="label">
<label>Back Orders</label>
<statuses>
<backorders default="1"/>
</statuses>
</backorders>
</states>
</order>
</sales>
mysql script
<?php
$installer = $this;
$installer->startSetup();
// Required tables
$statusTable = $installer->getTable('sales/order_status');
$statusStateTable = $installer->getTable('sales/order_status_state');
// Insert statuses
$installer->getConnection()->insertArray(
$statusTable,
array('status', 'label'),
array(
array(
'status' => 'backorders',
'label' => 'Back Order'
)
)
);
// Insert states and mapping of statuses to states
$installer->getConnection()->insertArray(
$statusStateTable,
array('status', 'state', 'is_default'),
array(
array(
'status' => 'backorders',
'state' => 'backorders',
'is_default' => 1
)
)
);
$installer->endSetup();
During the back order the order status is saved to backorders and it will show in the admin panel order list. My question is the same order is not showing in the customers my account recent orders section.
Why this orders under status of backorders not showing in recent orders page?
In the admin panel if we create an invoice the order status is changed to Processing, but if i create an invoice for the orders wich belongs to backorders are not changed to Processing.But if i completed the shipping for backorders order it will change the order status to Completed
What is the issue causing this?
This is how i update the order status in the observer
$order->setData('state', 'backorders');
$order->setStatus('backorders');
$history = $order->addStatusHistoryComment('', false);
$history->setStatus('backorders')->setData('state', 'backorders')->setIsCustomerNotified(false);
$order->save();
After order saved(with the status of backorders) the success screen is like below.
if i update the order status like this everything is fine.
$order->setData('state', 'processing');
$order->setStatus('processing');
$history = $order->addStatusHistoryComment('', false);
$history->setStatus('processing')->setData('state', 'processing')->setIsCustomerNotified(false);
$order->save();
After order saved(with the status of processing) the success screen is like below.
I can clearly understand there were some issue with custom created status.but i cannot found out why was that.
new
and status isbackorder
.state
issue.$order->setData('state', 'new'); $order->setStatus('backorders'); $history = $order->addStatusHistoryComment('', false); $history->setStatus('backorders')->setData('state', 'new')->setIsCustomerNotified(false); $order->save();
do something like that