Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | unlock_address_field--2767809-3.patch | 461 bytes | Dom. |
Comments
Comment #2
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedComment #3
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedThis patch is just to show what I mean. If the feature is accepted and validated, I can add an update path if required.
Comment #4
mglamanHow do you collect payment?
Comment #5
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedThe address is not needed for payment in my case: people pay via Paypal or or credit card (custom process waiting for official Commerce Payment).
Comment #6
mglamanMakes 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.
Comment #7
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedI 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.
Comment #8
Stizzi CreditAttribution: Stizzi as a volunteer commentedYou 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)
Comment #9
mglamanSo 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 :)
Comment #10
mglamanStizzi, saw your comment a bit late.
There are fornats you can choose. This might be a follow up in Address if needed
Comment #11
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commented@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.
Comment #12
lukasss CreditAttribution: lukasss commentedDrupal has always been famous for their flexibility!
Alas, while commerce2 does not hold...
I hope that something will change in the future.
Comment #13
Mikechr CreditAttribution: Mikechr at Tabs & Spaces commentedThis seems to still be an issue. I simply want to make the postal code required and have no option to so.