answer to your question is simple order is not a object make it an array.
var order = new Array();
order.push(/item to push/);
when ever this error appears just check the left of which property the error is in this case it is push which is order[] so it is undefined.