How is the shipping address for an order determined?

The answer to this question will be determined by the site settings and the type of site.
 
B2B Sites
 
In a B2B site, there are three options for Address Book Mode: Address Book, Locations and Both. This setting is found in Sites > [site name] > Settings > General Info tab in the Shopping cart section. The ship to address will be determined in part by this setting. See below for an explanation of how the ship to address is determined for each Address Book Mode:
 
 
Address Book
 
If the site uses Address Book Mode, the user will maintain their own address book. In Sites > [site name] > Settings > General Info tab in the Shopping Cart section, there is a setting labeled "Display Shipping Address Location List". If this is turned off, the user's primary address will be used. The user's primary address is set in their address book by the user. There is not a way for you to set this for them in Admin. If this is turned on, the user will select an address from their address book. They will also have the option of adding a new address to the address book and using the new address as the ship to location.

Locations
 
In Sites > [site name] > Settings > General Info tab in the Shopping Cart section, there is a setting labeled "Display Shipping Address Location List". If this is turned off, the user's primary address will be used and the user will not be able to select a shipping address. In Locations mode, the user's primary address is the one selected in Sites > [site name] > Site Users > [site user] > General Information tab in the Additional Information section in the "Location" field. If  "Display Shipping Address Location List" is turned on then the shipping address will be selected by the user from the list of locations found in Sites > [site name] > Locations and Departments.
 
Both
 
If "Display Shipping Address Location List" is on, the user will select the address from either the list of locations or from their address book. If "Display Shipping Address Location List" is off, it ships to the user's primary address. The primary address is the location selected in Sites > [site name] > Site Users > [site user] > General Information tab in the Additional information section in the "Location" field.
 
B2C/Retail Sites
 
In a B2C site/retail site, the Address Book Mode will always be set to Address Book Mode. There is no option to change this. This means that the user will maintain their own address book. They will enter or select their shipping address from their address book. The primary address in their address book is set by the user. There is no setting in admin for the user's primary address in this case.
 
 
Related article: Ch. 031 Shopping Cart Setup