LokiCheckout_AddressAutocompleteFetchify
Installation
Install this package via composer:
composer require loki-checkout/magento2-address-autocomplete-fetchify
Next, enable this module:
bin/magento module:enable LokiCheckout_AddressAutocompleteFetchify
Configuration
Configure the module under Stores > Configuration > Loki Checkout > Address Autocomplete via Fetchify:
- Access Token: The access token provided by Fetchify (stored encrypted). Use the Validate Access Token button to check it.
- Mode:
- UK Postcode Lookup: Customers enter their postcode and house number (or building name). The street, city and county are then filled in automatically.
- Address Finder: A search field. Customers type part of their address and pick it from a list.
- Auto: The UK Postcode Lookup for the lookup countries and the Address Finder for all other countries.
- API Mode:
Livecalls the Fetchify API.Testnever calls Fetchify and uses fixed responses instead (see below). - UK Postcode Lookup Countries: The countries that use the UK Postcode Lookup. Default: United Kingdom, Isle of Man, Jersey and Guernsey (all of which use Royal Mail postcodes).
- Address Finder Countries: The countries that show the Address Finder. Leave empty for all countries.
- Save Company Name: Also save the company name of an address that is selected in the Address Finder (an existing company name is cleared when the selected address has none), or of the house number that is matched by the UK Postcode Lookup.
- UK Postcode Lookup County Data: The county that the UK Postcode Lookup saves as region: none, former postal counties or traditional counties (default).
- Address Finder Fills UK Counties: Save the county of UK addresses that are selected in the Address Finder (default Yes).
- Address Finder Exclude Areas: A comma-separated list of Fetchify exclusion areas (like
gbr_northern_ireland). In the mode Auto,gbr_isle_of_manandgbr_channel_islandsare added automatically when the Isle of Man, Jersey or Guernsey are UK Postcode Lookup countries. - Address Finder Exclude PO Boxes: Exclude PO Box addresses from the Address Finder results.
- Remove +4 from US ZIP Codes: Remove the plus-four codes from US ZIP codes in the Address Finder.
- Address Finder Rate Limit: The maximum number of Address Finder searches per customer session per minute (default 60, 0 disables the limit). Further searches get the HTTP status 429.
- Cache Lifetime: The number of seconds that successful Fetchify responses are cached (default 86400, 0 disables caching), so that repeated lookups do not use up credits. The cache is cleaned with a full cache flush. Responses are never cached in the API mode
Test. - API Client Timeout: The number of seconds after which a call to Fetchify times out.
The general autocompletion settings (enable, toggle, region, house number additions) live under Address Autocompletion (module LokiCheckout_AddressAutocomplete).
When the Fetchify API fails (for instance, because the access token is invalid or the credits are used up), the error is logged and the customer can enter the address manually.
Differences with the original Fetchify module
This module covers the address features of the original Fetchify module (fetchify/module-fetchify), but calls the Fetchify API from the server instead of loading the Fetchify JavaScript widget. The following features of the original module are not included:
- Phone Validation and Email Validation: These are separate Fetchify products.
- Style settings (mode, ambient, accent), custom texts, search element ID and Use first address line for search: These only apply to the Fetchify JavaScript widget. Texts can be changed via translations.
- Hide Address Fields: Use the autocompletion toggle of
LokiCheckout_AddressAutocompleteinstead. - Transliteration and the access token format check.
- Forms outside the Loki Checkout (customer account, registration, multishipping, admin orders).
Testing
Fetchify offers test postcodes that are not charged: AA1 1AA, AA1 1AB, AA1 1AD and AA1 1AE (UK Postcode Lookup, fictitious data) and SL6 7RJ (Address Auto-Complete, real data).
In the API mode Test, these same responses are served from Client/Mock/fixtures/ without calling Fetchify. The Address Finder query SL6 returns a grouping that expands into the SL6 7RJ addresses. The fictitious Jersey postcode JE1 1AA only exists in this test mode. The access token invalid-access-token returns an "invalid access token" error. The Playwright tests use this mode by default.
To run the Playwright tests against the live API instead, set the environment variables FETCHIFY_API_MODE=live and FETCHIFY_TOKEN.
The live integration test (Test/Integration/Client/FetchifyClientFactoryTest::testLiveApiWithTestPostcodes) runs only when FETCHIFY_TOKEN is set.
The features of this module are described as user stories in the stories/ folder, each with references to the tests that cover them.
Current status
Support
For getting support, create an Issue under the following project URL:
https://gitlab.yireo.com/loki-checkout/LokiCheckout_AddressAutocompleteFetchify.git
Configuration Options
The following options of this module can be configured via the Store Configuration:
loki_checkout/address_autocomplete_fetchify/enable
loki_checkout/address_autocomplete_fetchify/api_key
loki_checkout/address_autocomplete_fetchify/api_check
loki_checkout/address_autocomplete_fetchify/api_mode
loki_checkout/address_autocomplete_fetchify/mode
loki_checkout/address_autocomplete_fetchify/lookup_countries
loki_checkout/address_autocomplete_fetchify/finder_countries
loki_checkout/address_autocomplete_fetchify/save_company
loki_checkout/address_autocomplete_fetchify/finder_rate_limit
loki_checkout/address_autocomplete_fetchify/cache_lifetime
loki_checkout/address_autocomplete_fetchify/api_client_timeout
Loki Components
The following LokiComponents are created or references in this module:
loki-checkout.billing.address.address_autocomplete_toggle
loki-checkout.billing.address.country_id
loki-checkout.billing.address.fetchify_finder
loki-checkout.shipping.address.address_autocomplete_toggle
loki-checkout.shipping.address.country_id
loki-checkout.shipping.address.fetchify_finder
Module Dependencies
The following dependencies are declared in the module its `etc/module.xml` file:
LokiCheckout_AddressAutocomplete
LokiCheckout_Core
Loki_Base
Loki_Components
Loki_CssUtils
Loki_FieldComponents
Magento_AdminNotification
Magento_Backend
Magento_Catalog
Magento_CatalogInventory
Magento_Checkout
Magento_CheckoutAgreements
Magento_Cms
Magento_Config
Magento_Csp
Magento_Customer
Magento_Directory
Magento_Eav
Magento_Indexer
Magento_MediaGalleryUiApi
Magento_Newsletter
Magento_Payment
Magento_Quote
Magento_Rule
Magento_Sales
Magento_SalesRule
Magento_SalesSequence
Magento_Shipping
Magento_Store
Magento_Tax
Magento_Theme
Magento_Ui
Magento_User
Magento_Variable
Magento_Vault
Magento_Widget
Yireo_CspUtilities
Composer details
LokiCheckout_AddressAutocompleteFetchifyloki-checkout/magento2-address-autocomplete-fetchify
ext-json: *
ext-pcre: *
guzzlehttp/guzzle: ^7.10
guzzlehttp/promises: ^1.4 || ^2.0
guzzlehttp/psr7: ^2.0
loki-checkout/magento2-address-auto-complete: ^1.0.3
loki-checkout/magento2-core: ^2.7
loki/magento2-components: ^2.8.3
loki/magento2-css-utils: ^1.1
loki/magento2-field-components: ^2.2
magento/framework: ^103.0
magento/module-backend: ^102.0
magento/module-checkout: ^100.4
magento/module-config: ^101.2
magento/module-directory: ^100.4
magento/module-quote: ^101.2
magento/module-store: ^101.1
php: >=8.2 <8.6
psr/http-message: ^1.0 || ^2.0
psr/log: ^1.0 || ^2.0 || ^3.0
Releases
| 0.0.2 | 11 November 2026 |
| 0.0.1 | 11 November 2026 |
Changelog
[0.0.2] - 09 November 2026
Fixed
- Document features as user stories and describe new settings
- Cover billing finder, Jersey lookup, finder countries, admin validation and accessibility
Added
- Add en_US and nl_NL translations
- Make the Address Finder an accessible combobox with status messages
- Optionally save the company name of the selected address
- Rate limit searches per session and prevent HTTP caching
- Cache successful Fetchify responses
- Make the UK Postcode Lookup and Address Finder countries configurable
[0.0.1] - 30 October 2026
Added
- Initial Fetchify UK Postcode Lookup and Address Finder