Hi,
It seems like there is a lot of talk over adding this one field to the
spree core. Has anyone thought of adding generic meta data fields to the
addresses that are not required (for example: metadata1, metadata2,
metadata3). I realize this isn't always the best data model to extend an
object with generic fields, but it seems likely that in most situations
no more than several custom fields would be required and this eliminates
the argument over what to call each extended field or what to include in
the core. This might be a situation where you are sacrificing the data
model a bit for improved flexibility to many developers.
After adding three metadata fields, a developer would be required to:
1) update the locale file for display of that field (company, firm,
business, address3, cow, moose, etc etc)
2) add validation for the field in an extension (validate_presence_of
metadata1) if necessary
3) update the frontend and admin address views to show this new field
All of these things would be required for any developer that wants to
extend the address currently. With the checkout javascript validation
method, a simple class="required" could be added to the input so that
the element would be validated. I could see some situations requiring
more modification of the checkout javascript, but I've had luck with
using a separate javascript that binds / unbinds onclick events and adds
additional listeners to avoid messing with the core checkout javascript.
IMO, it's not that hairy to extend the checkout model in the first
place. You'll have to do the steps mentioned above plus add a migration
file. Maybe there are other mysterious things that would be required
that I can't think of right now, but perhaps offering this kind of
metadata flexibility would appeal to many business cases and would
eliminate the need for us to discuss what to call the field.
~Steph
Jeff Seibert wrote:
> I am in agreement here, though the field should be called "company" or
> "company_name" or "firm" or "business" because it is the name of the
> organization, not the address.
>
> Jeff
>
> On Aug 18, 2009, at 1:40 PM, Peter Berkenbosch wrote:
>
>> On Aug 18, 2009, at 7:30 PM, Marcin Raczkowski wrote:
>>
>>>
>>> IMHO, address1 and address2 are bad enough, adding address3 (in
>>> front of
>>> address1 and address2 nevertheless) wold only confuse everyone.
>>> I vote for company_address + option to disable it.
>>
>> I totally agree.. +1 for company_address
>> ----
>> Peter Berkenbosch
>>
peterber...@me.com <mailto:
peterber...@me.com>