Loqate (Address Capture)
This module provides address lookup functionality using Loqate. It integrates with Drupal forms, fields, and Webforms, allowing users to easily search for and select addresses. It also offers support for the Address module for seamless integration.
This module integrates Loqate (previously PCA/Addressy) address lookup with Drupal. It adds a Form element, a field type and widgets, optional Webform elements, and Address module support for both forms and field widgets.
Requirements
- Drupal 9, 10, or 11
- Key - stores the Loqate API key securely (Key).
- A Loqate API key from your Loqate account (Create an API Key).
Optional dependencies
- Address - required by the PCA Address submodule (
pca_address) for Address field integration (Address). - Webform - required by the PCA Webform submodule (
pca_webform) and for the Loqate address Webform element (Webform)
Installation
- Install the module
composer require 'drupal/loqate:^3.0' - Add the API key
/admin/config/services/loqate-api
Usage
Form element
// Use #type "pca_address_advanced" for the Address module variant.
$form['shipping_address'] = [
'#type' => 'pca_address',
'#title' => $this->t('Shipping Address'),
'#show_address_fields' => FALSE,
'#allow_manual_input' => TRUE,
];
Please see the documentation for more details.
Field widget
Address module support
Install the pca_address submodule to enable Address module support for both a FormElement (Form API) and field widget. The field widget can be used on the Address module's address field type.
Webform element
- Enable the
pca_webformsubmodule - Go to your Webform and select the element type called "PCA address" which you can find under "Composite elements".
drush cr
Address Field Lookup support
This is being worked on in #2997232: Address module support via Address Field Lookup.
Documentation
Similar modules
- Webform Capture+ project - Drupal 6 and 7 support
- Postcode Anywhere (PCA) - PCA integration (Supports
6.xand7.x) - Postcodeanywhere Addressfield -
7.xPCA lookup with Address Field