Discussions

add additional order status?

I've been reading about how states and statuses are defined here:
http://www.drupalcommerce.org/specification/info-hooks/order

I've also seen how the various states and statuses are defined in commerce_order.module

The goal is to add a second processing status, which I assume would look like this

$order_statuses['processing2'] = array(
'name' => 'processing2',
'title' => t('Processing2'),
'state' => 'pending',
'weight' => 6,
);

based on the normal processing status, which looks like this:

$order_statuses['processing'] = array(
'name' => 'processing',
'title' => t('Processing'),
'state' => 'pending',
'weight' => 5,
);

But where does this get defined? I surely can't go fidgeting with the commerce_order.module file.

Do I create a module that simply includes this status "definition" inside a function?

Thanks!

Posted: May 28, 2012

Comments

photoboy on May 28, 2012

Basically yes, that's what I do :-).

It's just a matter of being brave and installing and uninstalling and tweaking your home-brewed module over and over again until it works.

I seem to have figured this out, using the attached module, although I don't think I got the weights right.

Tons of fun!