How to get the last order programmatically?

See also: