Hi,

The common way of inserting addresses in Belgium, is to split up the streetname and street number :

Streetname Streetnumber
Postal code City
Country

I made some changes to make this possible.

Patch attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Peter van den Heuvel’s picture

Noted before: it's also good practice to include the option for adding a province.

tijsdeboeck’s picture

Just came across this issue, but noticed that the patch doesn't work anymore, because of changes to plugins/format/address.inc

In case anyone needs this as well, you could always create a custom module for this, so you don't have to patch the addressfield module.

custom_module/custom_module.info

name = Addressfield Belgium overrides
description = "Enables a Belgium specific handler for address field"
core = 7.x
version = "7.x-1.x-dev"

dependencies[] = addressfield

custom_module/custom_module.module

<?php
/**
 * Hook addressfield format
 * Implements hook_ctools_plugin_directory().
 */
function ls_commerce_checkout_ctools_plugin_directory($module, $plugin) {
  if ($module == 'addressfield') {
    return 'plugins/' . $plugin;
  }
}

custom_module/plugins/format/addressfield-be-format.inc

<?php
/**
 * @file
 * A specific Belgium handler for address field
 */

$plugin = array(
  'title' => t('Enable specific overrides for Belgium'),
  'format callback' => 'addressfield_format_address_be_generate',
  'type' => 'address',
  'weight' => -80,
);

function addressfield_format_address_be_generate(&$format, $address, $context = array()) {
  if ($address['country'] == 'BE' && $context['mode'] == 'form') {
    $format['street_block']['#attributes']['class'][] = 'addressfield-container-inline';
    $format['street_block']['thoroughfare']['#title'] = t('Street');
    $format['street_block']['premise']['#title'] = t('House number');
    $format['street_block']['premise']['#size'] = 10;
  }
}