I would suggest adding a new order status instead of modifying the "Completed" order status, since that usually means the order is done-done-done. Something like "Pending: Shipping" (in the "Pending" order state) would make more sense given a workflow like this:
- Pending: Pending -- The order is paid and ready for shipping.
- Pending: Shipping* -- The order has shipped and may have a tracking number attached. *Note: You would need to add this status value in a custom module.
- Completed: Completed -- The order was delivered, shipping has been fulfilled, no further action required by the store.
See also:
You can certainly add to the "Pending" state as suggested above for something simple. For a more detailed example, you can also have a separate "Shipping" state and statuses:
/**
* Shipping status
*/
define('SHIPPING_PENDING', 'shipping_pending');
define('SHIPPING_SHIPPED', 'shipping_shipped');
define('SHIPPING_DELAYED', 'shipping_delayed');
define('SHIPPING_CANCELED', 'shipping_canceled');
define('SHIPPING_DELIVERED', 'shipping_delivered');
/**
* Implements hook_commerce_order_state_info()
*/
function example_commerce_order_state_info() {
$order_states = array();
$order_states['shipping'] = array(
'name' => 'shipping',
'title' => t('Shipping'),
'description' => t('Orders in the shipping process.'),
'weight' => 10,
'default_status' => SHIPPING_PENDING,
);
return $order_states;
}
/**
* Implements hook_commerce_order_status_info()
*/
function example_commerce_order_status_info() {
$order_statuses = array();
$order_statuses[SHIPPING_PENDING] = array(
'name' => SHIPPING_PENDING,
'title' => t('Shipping: Pending'),
'state' => 'shipping',
'weight' => 1,
);
$order_statuses[SHIPPING_SHIPPED] = array(
'name' => SHIPPING_SHIPPED,
'title' => t('Shipping: Shipped'),
'state' => 'shipping',
'weight' => 2,
);
$order_statuses[SHIPPING_DELAYED] = array(
'name' => SHIPPING_DELAYED,
'title' => t('Shipping: Delayed'),
'state' => 'shipping',
'weight' => 3,
);
$order_statuses[SHIPPING_CANCELED] = array(
'name' => SHIPPING_CANCELED,
'title' => t('Shipping: Canceled'),
'state' => 'shipping',
'weight' => 4,
);
$order_statuses[SHIPPING_DELIVERED] = array(
'name' => SHIPPING_DELIVERED,
'title' => t('Shipping: Delivered'),
'state' => 'shipping',
'weight' => 5,
);
return $order_statuses;
}