Problem/Motivation

I want to create a pure online ordering website using Drupal Commerce 2.x. In that case, customer adress is not required. Morevoer, I don't actually want to collect the address.

To do so, I need either to delete the address field in the billing profile type, or to make it optionnal. What is the purpose to lock this field ? Can't we just unlock it, let the address field be mandatory by default but give the opportunity to the store manager to decide whether the address should be or not ?

Proposed resolution

Simply unlock this field.

CommentFileSizeAuthor
#3 unlock_address_field--2767809-3.patch461 bytesDom.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dom. created an issue. See original summary.

Dom.’s picture

Dom.’s picture

This patch is just to show what I mean. If the feature is accepted and validated, I can add an update path if required.

mglaman’s picture

How do you collect payment?

Dom.’s picture

The address is not needed for payment in my case: people pay via Paypal or or credit card (custom process waiting for official Commerce Payment).

mglaman’s picture

Makes sense. Can't you just hide the pane on checkout? I doubt the field will be unlocked, we don't want it to be unexpectedly deleted when required in most use cases.

Dom.’s picture

I can totally do this.
Also I can alter the billing pane via custom module to make the address optionnal or unlock the field via code. It's not really a "how to make it" issue, I just did not understood why on the first place the field was locked. But it makes more sense for most, then why not.

Stizzi’s picture

You have to charge digital VAT in the EU when selling digital goods, the country is good to have as mandatory. The zip code may also be required in special cases, depending on which country the customer is resident. Street could be an option but not mandatory when selling digital goods. I do not know if the address field can be split up (I am Drupal beginner/nOOb)

mglaman’s picture

Status: Active » Closed (works as designed)

So we lock quite a few fields.. basically any field which should have been a base field on an entity is locked. However in this case we don't control the profile entity, and we expect to have a billing profile with some kind of address.

If hiding the billing profile field from the order type's form display and the checkout pane work, then that can be the valid workaround. I'm going to close this as "works as designed." But at least we have a valid workaround :)

mglaman’s picture

Stizzi, saw your comment a bit late.

There are fornats you can choose. This might be a follow up in Address if needed

Dom.’s picture

@mglaman, @Stizzi: there are configuration options in the address field. For instance a default country, or choosing which lines you want to remove (organization name, second street field, etc..). But all this needs configurations you can't do from the UI since the field is locked.

lukasss’s picture

Drupal has always been famous for their flexibility!
Alas, while commerce2 does not hold...
I hope that something will change in the future.

Mikechr’s picture

This seems to still be an issue. I simply want to make the postal code required and have no option to so.