Our client’s store is mostly products that are available for Local pickup ONLY. Orders with these products do not have a Delivery Method. The delivery_method variable is not set!
For other products in the store, Customers are presented with the option of Shipping or Local Pickup in the Checkout. The selection appears to set the delivery_method to Local pickup or Ship.
But when Local pickup only products are in the Checkout, the selection for delivery method does not appear, and there’s no mechanism (I believe) to set the delivery_method variable.
Note: For these products, the “This is a physical product” checkbox (under Shipping on the Product page) is unchecked (that is, requires_shipping == FALSE). This was necessary to “fool” Shopify so that it doesn’t offer the Ship option to products that are Local pickup only!
I think this might be contributing to other issues, like transaction alerts, where the IP address and the shipping address (which doesn’t exist!) are different locations!