# addressfinder/module-magento2

`composer require addressfinder/module-magento2`

Canonical URL: https://packagento.com/addressfinder/module-magento2

## At a glance

- **Vendor**: addressfinder (https://packagento.com/addressfinder.md)
- **Latest version**: 2.1.1 — released 2024-10-01
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/addressfinder/module-magento2 and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require addressfinder/module-magento2:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## README

The AddressFinder module for Magento 2 allows you to find verified [Australian](https://addressfinder.com.au) and [New Zealand](https://addressfinder.nz) addresses with an intuitive, search-as-you-type interface.

### 1. Installation

The module may be installed one of two ways:

1. Composer (recommended)
2. Manual

#### 1.1 Via Composer

To install the module via Composer, from the root directory of your Magento installation:

```bash
composer require addressfinder/module-magento2
```

This will automatically fetch the latest compatible version of the module available to your Magento installation. From the root directory of your Magento installation:

```bash
bin/magento module:enable AddressFinder_AddressFinder
bin/magento setup:upgrade
```

#### 1.2 Install manually

To install the module manually, download the source code for the latest **compatible version** of the module:

| Magento Version | Latest Compatible Version                                    |
| --------------- | ------------------------------------------------------------ |
| 2.0.*           | [1.3.0 (download)](https://github.com/AddressFinder/addressfinder-magento/releases/tag/v1.3.0) |
| 2.1.*           | [1.5.1 (download)](https://github.com/AddressFinder/addressfinder-magento/releases/tag/v1.5.1) |
| 2.2.*           | [1.5.1 (download)](https://github.com/AddressFinder/addressfinder-magento/releases/tag/v1.5.1) |
| 2.3.*           | [2.0.4 (download)](https://github.com/AddressFinder/addressfinder-magento/releases/tag/v2.0.4) |
| 2.4.*           | [2.0.5 (download)](https://github.com/AddressFinder/addressfinder-magento/releases/tag/v2.0.5) |
| 2.4.*           | [2.1.0 (download)](https://github.com/AddressFinder/addressfinder-magento/releases/tag/v2.1.0) |
| 2.4.*           | [2.1.1 (download)](https://github.com/AddressFinder/addressfinder-magento/releases/tag/v2.1.1) |

Extract the  `.zip` / `.tar.gz` you have downloaded. Copy the **contents of the top-level folder** that was created during extraction into your Magento store in the following location (you must create these folders manually):

```
app/code/AddressFinder/AddressFinder/
```

After copying the contents into this location, you should see a structure containing (but not limited to) the following files/folders:

```
app/code/AddressFinder/AddressFinder/Block/
app/code/AddressFinder/AddressFinder/etc/
app/code/AddressFinder/AddressFinder/Model/
app/code/AddressFinder/AddressFinder/registration.php
app/code/AddressFinder/AddressFinder/...
```

From the root directory of your Magento installation:

```bash
bin/magento module:enable AddressFinder_AddressFinder
bin/magento setup:upgrade
```

#### 1.3 Production considerations

Although outside the scope of installing this module, if you are running your Magento store in a production environment, you should run the [Magento code compiler](https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-compiler.html) and [deploy static files](https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-static-deploy-strategies.html):

```bash
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
```

### 2. Updating

The process for updating the module depends on whether you have installed it via Composer or manually.

#### 2.1 Via Composer

To update the module via Composer, from the root directory of your Magento installation:

```bash
composer update addressfinder/module-magento2
bin/magento setup:upgrade
```

> If you are running your Magento store in a production environment, refer to <u>Section (1.3) Production Considerations</u>.

#### 2.2 Update manually

To update the module manually, referring to the instructions in <u>Section (1.2) Install Manually</u> to download the latest compatible version and copy the files into your Magento codebase. After you have copied these files in, simply upgrade the extension:

``` bash
bin/magento setup:upgrade
```

> If you are running your Magento store in a production environment, refer to <u>Section (1.3) Production Considerations</u>.

### 3. Configuring the module

The module's settings are controlled within `Stores -> Configuration -> Services -> AddressFinder`.

> Most settings in Magento 2 are guarded with sensible defaults. To customise settings,  you'll need to uncheck the **use system value** for any settings you would like to customise.

#### 3.1 Basic functionality

 To get the module functioning in its most basic form, you'll need to:

1. Change **Enabled** to **Yes**.
2. Sign up for a licence key for [Australia](https://addressfinder.com.au/plans/?utm_source=magento&utm_medium=extension&utm_campaign=magento_admin&utm_term=Australia) or [New Zealand](https://addressfinder.nz/plans/?utm_source=magento&utm_medium=extension&utm_campaign=magento_admin&utm_term=New_Zealand) and enter this in the **License** field.

#### 3.2 Customisation features

1. Depending on the theme your Magento store has, you may need to configure the **Default Search Country** if your checkout has no country selector.
2. AddressFinder functions across many forms throughout Magento. The default is to enable it in all supported forms, however you may restrict this with the **Enable Specific Forms** setting.
3. Turning on **Debug Mode** will print debug messages from the AddressFinder JavaScript widget to the browser's console.
4. You may pass custom **Widget Options** to the JavaScript widget. This must be a JSON object valid for [Australia](https://addressfinder.com.au/docs/widget_docs?utm_source=magento&utm_medium=extension&utm_campaign=magento_admin&utm_term=Australia#options) or [New Zealand](https://addressfinder.nz/docs/widget_docs?utm_source=magento&utm_medium=extension&utm_campaign=magento_admin&utm_term=New_Zealand#options).

### 4. Forms

The AddressFinder module is installed within Magento by attaching forms. Out of the box, we support the following frontend forms:

_(README truncated for .md surface. Full README on https://packagento.com/addressfinder/module-magento2.)_

## Changelog

* Add support for restricted CSP policy mode in Admin order page (turned on by default in Magento 2.4.7)

## AddressFinder 2.1.0 (September 18th 2024)
* Add client agent reporting

## AddressFinder 2.0.5 (Jul 16th 2024)
* Add support for restricted CSP policy mode turned on by default in Magento 2.4.7

## AddressFinder 2.0.4 (Jan 15th 2024)
* Add support for PHP 8.2 and 8.3

## AddressFinder 2.0.3 (May 9th 2022)
* Add support for PHP 8.0 and 8.1

## AddressFinder 2.0.2 (August 23rd 2021)
* Add support for billing address for bank transfer payments
* Fix problem with default country on checkout

## AddressFinder 2.0.1 (October 29th 2020)
* Update documentation
* Bug fix - allows all PHP versions that Magento 2.3 allows

## AddressFinder 2.0.0 (September 4th 2020)
* Allow PHP 7.3 or 7.4 - Drop support for Magento 2.1 and 2.2

## AddressFinder 1.5.1 (August 31th 2020)
* Upgrade to webpage tools v1.8.4

## AddressFinder 1.5.0 (May 14th 2020)
* Add AddressFinder to the Order form address fields for Magento 2.2 and 2.3
* Bug fix - Allow NZ or AU to be disabled/uninstalled in Magento
* Refactor form config observers
* Update dependencies

## AddressFinder 1.4.0 (January 6th 2020)
* Fetch state mappings and payment methods server side.
* Officially remove support for Magento 2.0

## AddressFinder 1.3.0 (December 9th 2019)
* Utilise NPM
* Upgrades JavaScript dependencies
* Refactor project structure

## AddressFinder 1.2.5 (October 25th 2019)
* Added default static country to default to if the country select field is not present.

## AddressFinder 1.2.4 (October 16th 2019)
* Readme.md updates

## AddressFinder 1.2.3 (October 15th 2019)
* Differentiate between Magento version and webpage tools version

## AddressFinder 1.2.2 (October 14th 2019)
* Update to webpage tools v1.6.0

## AddressFinder 1.2.1 (June 13th 2019)
* Fix fault with incorrectly named widgetOptions

## AddressFinder 1.2.0 (May 17th 2019)
* Use webpage tools package

## AddressFinder 1.1.8 (April 2nd 2019)
* Update Documentation for Magento development

## AddressFinder 1.1.7 (March 15th 2019)
* Update Gulp
* Add version number to widget code

## AddressFinder 1.1.6 (March 5th 2019)
* Update Reqwest library to version 2

## AddressFinder 1.1.5 (March 1st 2019)
* Allow events to bubble and be canceled

## AddressFinder 1.1.4 (February 28th 2019)
* Fixes dispatch event compatability on IE11

## Recent Versions

| Version | Released |
|---|---|
| 2.1.1 | 2024-10-01 |
| 2.1.0 | 2024-09-18 |
| 2.0.5 | 2024-07-16 |
| 2.0.4 | 2024-01-15 |
| 2.0.3 | 2022-05-09 |
| 2.0.2 | 2021-08-23 |
| 2.0.1 | 2020-10-28 |
| 2.0.0 | 2020-09-04 |
| 1.5.1 | 2020-08-31 |
| 1.5.0 | 2020-05-13 |

Showing 10 of 29 versions. Full release history on https://packagento.com/addressfinder/module-magento2.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| ext-json | * |
| magento/framework | 102.0.*\|103.0.* |
| magento/module-store | 101.0.*\|101.1.* |
| php | ~7.1\|\|~8.0 |

### Require (dev)

| Package | Constraint |
|---|---|
| phpunit/phpunit | ~6.5.0 |
| roave/security-advisories | dev-master |

## Quality

Latest release (2.1.1) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 17 | 17 warnings (ruleset: Magento2) — 2 auto-fixable with phpcbf |
| PHPMD | Warning | 1 | 1 rule violation (UnusedLocalVariable:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 4 | 4 | – | – |
| 2.4.8 | – | 4 | 4 | – |
| 2.4.9 | – | – | 4 | 4 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | N/A | 0 | no resolvable dependency tree to audit — Your requirements could not be resolved to an installable set of packages. Problem 1 |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["addressfinder/module-magento2"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

addressfinder is a Magento 2 vendor on Packagento. See https://packagento.com/addressfinder.md for their full catalogue.

