Hi all,

I‘m currently moving our old site to drupal 4.7 w/ ecommerce. Beta will be up soon. We mainly sell our stuff to business customers in Europe.

Enclosed you‘ll find a patch for the address module with following modifications:

  1. Re-arranged fields
  2. Added company field
  3. Added vat id field (is needed for intra EU sales)
  4. Vat id field is only shown when country is one of EU 25
  5. Set province/region to optional
  6. Added address_detail_view function which is called from address_checkoutapi case 'review'

Comments:
ad 1: Personal preference (Should be changeable via settings in the future)
ad 3: I put the vat id field into ec_address because the id is bound to the company and location.
ad 6: Needed for reliable tax calculations and exempts. User should not be able to change address via popup at this stage

DB modifications:

ALTER TABLE `ec_address` ADD `company` VARCHAR(216) NOT NULL AFTER `lastname`, ADD `vatid` VARCHAR(24) NOT NULL AFTER `company`;

Todo:
Future versions of the tax module can use the vatid fields from ec_address.

This is my first input, please review carefully.

Thank you all for the good stuff

Kurt

CommentFileSizeAuthor
address_w_company_vatid.patch7.49 KBkje

Comments

matt westgate’s picture

What the address module really needs to do is find a way to use profile modules fields rather than creating its own. Once we successfully harness the power of profile module, adding 'company' or 'vatid' become trivial.

arthurf’s picture

If you want to support this with non-logged in users, you also need to modify store.inc to output these fields.

I added to lines 226/227

fgm’s picture

Version: master » 4.6.x-1.x-dev
Component: address.module » address

Reclassified: uses the 4.6 API.

sime’s picture

Assigned: Unassigned » sime

I'll look to cover this in upcoming work.

sime’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)