# magento-swiftcomplete-autocomplete

Swiftcomplete real-time address autocomplete integration for Magento 2 checkout. Provides address, postcode, and what3words search during the shipping step and auto-fills the standard Magento address fields.

## Features

- Real-time address, postcode, and what3words search
- Autofills the standard Magento shipping address fields
- Loads the Swiftcomplete JavaScript component on the checkout page only
- Configurable API key and copy via Magento admin

## Requirements

- Magento 2.x
- PHP 8.0+
- Swiftcomplete API key ([Swiftcomplete account API keys](https://www.swiftcomplete.com/account/api/))

## Installation

```bash
composer require portalpeople/magento-swiftcomplete-autocomplete
bin/magento module:enable PortalPeople_Swiftcomplete
bin/magento setup:upgrade
bin/magento cache:clean
```

## Configuration

1. In Magento admin, go to **Stores → Configuration → Sales → Swiftcomplete Address Autocomplete**
2. Enter your Swiftcomplete API key
3. Save and clear cache

## Notes

- The checkout widget loads `https://assets.swiftcomplete.com/js/swiftlookup.js`.
- If Magento CSP is enabled, ensure `assets.swiftcomplete.com` and `*.swiftcomplete.com` are allowed.

## Related Modules

- [`magento-addresslookup`](../magento-addresslookup) — Legacy getAddress.io module (deprecated)
- [`ngauge-idealpostcode`](../ngauge-idealpostcode) — Alternative postcode lookup

## Support

[support@portalpeople.uk](mailto:support@portalpeople.uk)
