Vote up!
Vote down!

Order Types

I am currently busy with integrating our school management system with Drupal Commerce. I have successfully changed the bill run process to create orders in the system and parents have access to these when they log in.

What I am now trying to accomplish is to categorise the orders for easier management. I want orders that come from our on-line store to be of 'Order' type - the default - but I want to configure and use other order types:

Registration - For orders created when a parent registers their child
Deposit - For orders created when a parent accepts a place
Session - For recurring orders billing parents for hours provided

I have trawled the net and scanned through the documentation but cannot get hold of anything useful to help in this process. There is the Order Types module but I would like to control this code myself due to various reasons.

Any documentation on this or can anybody help out?


Mike Kovacevich
Asked by: Mike Kovacevich
on December 9, 2014

2 Answers

Vote up!
Vote down!

You'll probably shoot your eye out with this, but, sometimes you just gotta try things.

Thoroughly test on local copy before deploying:


We use the above module on marketplace.commerceguys.com without problems. We should probably blog about that.

Josh Miller
Answer by: Josh Miller
Posted: Dec 10, 2014


Also, another thought (that's less drastic than introducing more than the default order type) ... have you considered adding a taxonomy field to your order entities? It would integrate with Views and have a seamless checkout process without the hassle of choosing an order type.

An easy way to expose Order fields on checkout is the Field Group module:


- Josh Miller on December 10, 2014

Thanks for the info Josh. Will certainly look into the option of using a taxonomy field for the classification of orders. I presume I could easily make use of this field in Views as I require a view for a user to list their orders filtered by order type ala 'Show me all of my registration orders'.

- Mike Kovacevich on December 13, 2014

Thanks Josh. Added a taxonomy field to the order and this seems to do the job nicely. Had to update some views to hide the field from the user and there might be some other impacts I haven't come across yet but, for now, this seems like the less invasive option.

- Mike Kovacevich on January 30, 2015
Vote up!
Vote down!

Have you tried assigning different or adjusting Line Item types? I think this is what you are looking to do. Set or adjust the line item types to your needs in the store settings>line item types.

Answer by: garpy
Posted: Dec 9, 2014


Not so sure about using line item types as these would be specific to a product or line item. I need the data to sit at the order level for reporting, for example, give the user a list of all orders of type 'Registration'. This is relatively easy to do with Views and I presume would be relatively complex if I first had to determine if the line items were of a specific type and then aggregrate to order level - also what happens if I have line item type of 'Discount' for a discount and then line item type 'Registration fee' for a registration fee product? How would I then determine the order type?

The natural place for me is the order type field at order level but alas it seems to be very poorly supported by other modules/extensions eg. Commerce Discounts and Commerce Coupons. I suspect contrib modules don't take notice of order types due to lack of documentation and no UI support for them in 'core' Drupal Commerce. Would love to see Drupal Commerce provide UI support for order types.

- Mike Kovacevich on December 13, 2014