address_autocomplete

Triggered on auto-completion of the locality list when a user enters an address.

Shop-Script

Input (passed by reference)

$params array Array of addess values filled in by a user.
$params['country'] string Selected country’s code.
$params['region'] string Selected regoin’s code from system settings.
$params['city'] string Entered part of the locality name.
$params['zip'] string Entered ZIP code.
… your plugin code …

Output

$return
Sub-arrays with locality names specified in 'city' keys.
Shop-Script

Plugin code example

PHP

public function addressAutocomplete($params)
{
    return [
        [
            'city' => 'City name 1',
        ],
        [
            'city' => 'City name 2',
        ],
        //...
    ];
}