OrderCarrier.CustomerID is NOT customer ID

OrderCarrier.CustomerID is documented as:

Gets the customer ID of the customer to which this order belongs to.

If I do:

OrderCarrier.CustomerID.GetPerson() it returns null. Becuase OrderCarrier.CustomerID is NOT in fact the customer ID of the customer which this order belongs to, but a reference to the CustomerInfo object stored in the Ecommerce_CustomerInfo table.

So how do I get the actual CustomerID or Person from the OrderCarrier?

OrderCarrier.CustomerInfo.PersonID.GetPerson() will solve your problem.