How to disable the shipping address on the checkout?

On my project, the customers don’t need at all to have a shipping address. Worst : this form could even produce confusion because they must take off their order directly on the physical shop (it’s a food truck).
Ideally, I would remove it completly, but I suppose is used elsewhere on Commerce.
Is there a proper way to mask it from front-end and only using the billing address ?

Or should I have to insert a big warning “won’t be used for shipping !” ?

I think I will remove the optionnal billing address from twig template and keep the shipping one renamed as “who are you?” and it will do the job :slight_smile:

Sorry for not responding to this sooner.

One address of any type is required - but Commerce doesn’t really matter which type it is. Internally, a call to $order->getBillingAddress() (e.g. in the taxes calculation) will return the shipping address if no billing address was provided, and $order->getShippingAddress() (e.g. for determining shipping fees) will gladly return the billing address if no shipping was provided.

Only in specific places Commerce is strict about the address type. For example the order details view will only show a shipping address in the shipping address section.

From a templating perspective, it’s easier to remove the billing address section from the form, but Commerce will also work fine if you remove the shipping address section.

1 Like