Magento2 User Guide
Loqate AU & NZ Address Autocomplete extension module for Magento2
Version: 1.1.1
Prerequisites
Have Adobe Commerce / Magento platform installed.
Have a active Loqate Harmony API Account. You can sign-up for free trial here.
Downloaded Loqate Harmony - Adobe Commerce / Magento Plugin.
Features
Autocomplete billing and shipping address in Checkout page
Support all different Magento payment methods
Support Braintree Payments extension for credit card
Autocomplete address in My Account page for Customer's billing address and shipping address
Only enabled when country is selected as Australia or New Zealand
Configuration for address lookup options, such as Source of Truth
Control user authorisation via Access Control List (ACL) rules
Enable/Disable the module in Magento2 Admin
Releases
v1.0.x is compatible for Magento 2.2 (tested with Magento 2.2.4)
v1.1.x is compatible for Magento 2.3 (tested with Magento 2.3.4 and 2.2.4)
Installation
Go to your Magento2 Home (usually is in /var/www/html
directory).
It is recommended to backup the existing composer.json in your Magento2 Home directory:
Composer Installation
It is available in both GitHub and Packagist.
Make sure git is installed:
apt-get install git
.(Optional) To install from GitHub: add this GitHub Repository link to Magento2 composer.json:
This will append 'mastersoft' Repository reference with GitHub Repository URL in composer.json:
While to install from Packagist, there is no need to do this step.
To install the latest release:
composer require mastersoft/address-widget
.If you encounter this error:
InvalidArgumentException: Could not find package mastersoft/address-widget at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability.
This is because there is no release yet, alternative option is to install from
dev-master
branch:You can specify a specific version to be installed:
composer require <component-name>:<version>
.
If successful, you should find the module source in /var/www/html/vendor/mastersoft/address-widget/
directory.
Updating Existing Composer Installation
Update
./composer.json
with the version to be downloaded:composer require mastersoft/address-widget:<version> --no-update
. For example to get the latestmastersoft/address-widget
fromdev-master
branch:
Downloading and installing the specified
mastersoft/address-widget
version:composer update
.Clear the compiled code and cache in general:
php bin/magento setup:upgrade
.(For Production mode only) Recompile your Magento project:
php bin/magento setup:di:compile
.(For Production mode only) Deploy static files to
pub/static/
directory:
If you know the files and content that have been updated in this new version, you should be able to verify in the module source: /var/www/html/vendor/mastersoft/address-widget/
directory.
If after this installation, the page is blank or encounter permission error or other errors, please follow some commands in Post Installation.
Manual Installation
Download the zip file in
ZIP
directory.Unzip it in your Magento2 Home directory, it will merge with existing directories and files.
You should find the module source in /var/www/html/app/code/Mastersoft/AddressWidget/
directory.
Alternatively, you can also use the zip file downloaded from GitHub:
In GitHub -> click
Clone or download
button on top right corner -> clickDownload ZIP
link in GitHubIn Magento2 Home, create sub-directories
app/code/Mastersoft/AddressWidget/
.Unzip the content of the zip file to
app/code/Mastersoft/AddressWidget/
directory. You should seecomposer.json
andregistration.php
files directly in this directory.
Post Installation
These steps must be followed after Composer Installation or Manual Installation steps above.
Verify
Mastersoft_AddressWidget
module is installed properly:php bin/magento module:status
. It is now should be listed in the Disabled Modules.Enable the module:
php bin/magento module:enable Mastersoft_AddressWidget
.Register the extension and update the database:
php bin/magento setup:upgrade
.(For Production mode only) Recompile your Magento project:
php bin/magento setup:di:compile
.(For Production mode only) Deploy static files to
pub/static/
directory:This is very important for Production mode, otherwise your store and store admin will not load correctly because of some js and css files are not found, and users will not be able to load Checkout and edit Customer Address.
Verify
Mastersoft_AddressWidget
module is enabled:php bin/magento module:status
. It is now should be listed in the Enabled Modules.(Optional) Other commands maybe needed if the page is blank or encounter permission error or other errors:
Update Mastersoft Address Configuration.
Disabling/Enabling Module
There are 2 ways to disable/enable this module:
Magento Admin Go to Mastersoft Address Configuration: in
Enable Module
field, selectNo
to disable module orYes
to enable module, and clickSave Config
button.By disabling the module via Mastersoft Address Configuration, the module status is still enabled but it will not load the module javascript.
OR
Magento Command To disable module:
You can enable the module easily by following the Post Installation steps.
Uninstallation
Following these steps will fully uninstall this module: clean the module code, database, and any module references. You will need to follow the installation steps to be able to use this module again.
Composer Uninstallation
This will work only if the module was installed using Composer.
Disable
Mastersoft_AddressWidget
module by following Disabling/Enabling Module using Magento Command steps.Uninstall module:
-r
or--remove-data
: very important to remove the relevant configuration data stored in the database-c
or--clear-static-content
: remove the static content--backup-db
: backup the Magento2 database--backup-code
: backup Magento file system (excludingvar
andpub/static
directories)--backup-media
: backuppub/media
directory
These backup files will be stored in
var/backup/
directory.If the module was not installed using Composer, running this command will give an error. Continue the uninstallation by following the Manual Uninstallation steps.
Update database:
php bin/magento setup:upgrade
.IMPORTANT: If the module source under
vendor/mastersoft/address-widget/
directory is still not deleted, run:This will delete
mastersoft
directory undervendor
directory and properly clean all module references in composer configuration files.
Manual Uninstallation
Disable
Mastersoft_AddressWidget
module by following Disabling/Enabling Module using Magento Command steps.Delete module source directory:
Composer installation:
rm -rf vendor/mastersoft
orManual installation:
rm -rf app/code/Mastersoft
Clean database by logging in to magento2 database and execute these queries:
Remove module reference
Mastersoft_AddressWidget
inapp/etc/config.php
.Compile the code and clear the cache
Configuration
In Magento Admin Dashboard of your Store: Stores
-> Configuration
-> Services
-> Mastersoft Address
.
Licence Key (Mandatory) Default value: blank/empty. Must be in this format: username-without-domain:password. Get your FREE licence key here.
URL (Mandatory) Default value:
https://hosted.mastersoftgroup.com
Default Widget Options Generic Widget Options for both AUSTRALIA and NEW ZEALAND. Default value:
{ singleLineHitNumber: 5, caseType: 'TITLE' }
Widget Options for AUSTRALIA Default value:
{ sot: 'GNAF' }
Widget Options for NEW ZEALAND Default value:
{ sot: 'NZPAF' }
Enable Module Default value:
Yes
All Widget Options must be in valid JSON format and must use single-quote for String value, DO NOT use double-quote anywhere.
For Widget Options for certain country, if the same option key is defined in the Default Widget Options, the value in the Widget Options for certain country will take precedence over the value in the Default Widget Options.
To configure the Widget Options, here is the full list of FeatureOption available.
Setting ACL Rules
In Magento Admin Dashboard of your Store: System
-> User Roles
-> Add/Edit Role
-> Role Resources
.
Select Custom
from Resource Access
dropdown menu, you will see Mastersoft Address Configuration
rule, which now you can assign to admin roles in the system, and those admin roles can be assigned to users.
When this Mastersoft Address Configuration
rule is not checked for that particular role, whoever is assigned to this role will not be able to see and access the Mastersoft Address Configuration link and page.
Last updated