# Woocommerce Install Guide v2.0.0

Version: 2.0.0

All versions available in <https://github.com/MastersoftGroup/woocommerce-mastersoft-address/releases>

### Prerequisites

1. Have Wordpress platform and Woocommerce plugin installed or available oncloud.
2. Have a active Loqate Harmony API Account. You can sign-up for [free trial here](https://www.loqate.com/anz/register/).
3. Download Loqate AU NZ Woocommerce plugin from [github ](https://github.com/MastersoftGroup/woocommerce-mastersoft-address)or [packgist](https://packagist.org/packages/mastersoft/woocommerce-mastersoft-address)

### Features

Performance checkout with Address lookup and validation for WooCommerce Checkout and Account Billing and Shipping Addresses, as well as checkout with Address lookup and validation, business lookup and validation, email and phone validation​

Turns your checkout into a performance checkout by saving the customer time in checkout, reduces failed deliveries, reduces failed contacts and builds trust. Powered by the most curated address and location data in the world.

Loqate is the most advanced software for capturing, verifying and enriching address data globally - delivering the unrivalled precision businesses need.

Features:

* Autocomplete billing and shipping address, business lookup, email and phone validation in Checkout page
* Autocomplete address in My Account page for Customer's billing address and shipping address
* Support for over 245 countries addresses, including AU, NZ, US, UK, CA etc
* Flexible configurations for the lookup and validation depending on the business needs.

Get started with a [free trial here](https://www.loqate.com/anz/register/).

### Installation

This plugin requires WooCommerce. Please make sure WooCommerce is installed.

#### Automatic installation

Automatic installation is not currently available.

#### Manual installation

1. Download the zip file of the latest release from [GitHub](https://github.com/MastersoftGroup/woocommerce-mastersoft-address).
2. Upload the zip file to your WordPress plugins directory by either:
   * Upload the zip file using your WordPress Admin:

     Log in to WordPress Admin > go to `Plugins` > `Add New` > `Upload Plugin` button > upload the zip file

     **OR**
   * Upload and unzip the zip file into your WordPress plugins directory: `WP_ROOT/wp-content/plugins/`. The `WP_ROOT` is usually `/var/www/html/`.

After installation, the WordPress plugins directory should include the `woocommerce-mastersoft-address` directory with the same file structure as the GitHub.

#### Composer installation

The plugin is also available for installation from [Packagist](https://packagist.org/packages/mastersoft/woocommerce-mastersoft-address).

1. Download and install composer:

   ```
   $ curl -sS https://getcomposer.org/installer | php
   $ mv composer.phar /usr/local/bin/composer
   ```
2. Install with composer by either:
   * Create `composer.json` file in the `WP_ROOT` and add the `mastersoft/woocommerce-mastersoft-address` package. For example, to add `woocommerce-mastersoft address` v2.0.0.

     ```
     {
         "require": {
             "mastersoft/woocommerce-mastersoft-address": "2.0.0"
         }
     }
     ```

     Install the package:

     `$ composer install`

     **OR**
   * Use extended composer command and install:

     `$ composer require mastersoft/woocommerce-mastersoft-address:<version>`

     The `<version>` is optional.

After installation, the WordPress plugins directory should include the `woocommerce-mastersoft-address` directory with the same file structure as the GitHub.

**Updating an existing Composer installation**

1. Update `composer.json` in your WordPress plugins directory with the version to be downloaded:

   `$ composer require mastersoft/woocommerce-mastersoft-address:<version> --no-update`

   Alternatively, you can also update the version of `mastersoft/woocommerce-mastersoft-address` package in the `composer.json` file by directly editing it.
2. Download and install the updated version of `mastersoft/woocommerce-mastersoft-address`:

   `$ composer update`

#### Post installation

1. Activate plugin: log in your WordPress Admin > got to `Plugins` > `Installed Plugins` > scroll to `Loqate AU NZ Address` plugin and click `Activate`
2. Configure plugin by following the Configuration guide.

#### Disable/enable plugin

To disable: log in to your WordPress Admin > go to `Plugins` > `Installed Plugins` > scroll to `Loqate AU NZ Address` plugin and click `Deactivate` to disable plugin.

This will disable the functionality but will still keep all your configuration settings, so you do not need to configure when you enable the plugin again.

To enable: log in to your WordPress Admin > go to `Plugins` > `Installed Plugins` > scroll to `Loqate AU NZ Address` plugin and click `Activate` to enable plugin.

#### Uninstallation

Log in to your WordPress Admin > go to `Plugins` > `Installed Plugins` > scroll to `Loqate AU NZ Address` and click `Deactivate` and `Delete`.

This will uninstall and delete all the configuration settings in your database.

If there is an error message during the deleting process `Could not fully remove the plugin ....`, please make sure the file ownership is set to `www-data`. To correct the ownership, change to your WordPress plugins directory:

`$ chown -R www-data:www-data woocommerce-mastersoft-address`

### Configuration

Log in to your WordPress Admin > go to `WooCommerce` > `Settings` > `Loqate AU NZ Address`.

* **Licence Key:** (mandatory). Get your [free trial here](https://www.loqate.com/anz/register/). Must be in **username-without-domain:password** format. Default Value: blank/empty.
* **Address Layout Options:** Address layout options. Must be in valid format. Options {"layout":"OPTIMISED"} or {"layout":"DEFAULT"}. The preconfigured value:

  `{ "layout": "`OPTIMISED`" }`
* **Address Feature Options:** Must be in valid format. Full list of [Feature Options](/loqate-harmony-api/api-specification/objects/address-objects.md#featureoption). The preconfigured value:

  `{ "singleLineHitNumber": 5, "caseType": "TITLE", "displayGnafLot":1,"suppressLot":1 }`
* **Address Data AUSTRALIA:** Must be in valid format. The preconfigured value is {"sot":"GNAF"}. Options {"sot":"AUPAF"} , {"sot":"AUSOTS"} .

  `{ sot: "GNAF" }`
* **Address Data NEW ZEALAND:** Must be in valid format. Options {"sot":"NZAD", "exposeAttributes":"1"} , {"sot":"CNAR"}. The preconfigured value:

  `{ "sot": "NZPAF" }`
* **Enhanced State/Country/Region:**  checkbox. To enable this setting to make use of our comprehensive collection of state/county/region or the equivalent.
* **Business Lookup:**  checkbox. To enable business lookup.
* **Widget Options for Business Lookup:** Must be in valid format.Note: state only applicable for au business lookup, it will be ignored for other countries. Further documentation of the [options ](/loqate-harmony-api/api-specification/objects/business-objects.md#businessrequest). The preconfigured value:

  `​{ "caseType": "TITLE", "hits": 5, "taxStatus": "", "bnStatus": "", "state": ["NSW","VIC","QLD","ACT","SA","WA","NT"], "nameTypes": ["MN","BN","TRD","OTN","LGL","DGR"] }`&#x20;
* **Display Main/Legal Entity Name:**  checkbox. To enable this setting if you wish to populate main/legal entity name which might be different from the entity's alias name entered by user.
* **Email Validation:**  checkbox. To enable email validation.
* **Widget Options for Email Validation:** Must be in valid format. Further documentation of the [configuration](/loqate-harmony-api/api-specification/email-validation.md#request). The preconfigured value:

  `​`{ "sot": "VE\_ALL", "options": \[ "FORMAT", "BLOCKLIST", "DOMAIN", "MAILSERVER", "MAILBOX" ] }&#x20;
* **Phone Validation:**  checkbox. To enable phone validation.

### Frequently Asked Questions

#### How do I get a licence key?

You can get a  [free trial here](https://www.loqate.com/anz/register/) and start using it right away.

#### What are all available Widget Options to configure in the settings?

Widget Options are basically `sot` for `Source of Truth` value and key value of `FeatureOptions`.

Currently these Source of Truth are available for AUSTRALIA: `AUPAF`, `GNAF` and for NEW ZEALAND: `NZPAF`, `NZAD`.

Here is the full list of [Feature Options.](/loqate-harmony-api/api-specification/objects/address-objects.md#featureoption)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mastersoftgroup.com/loqate-harmony-api/integrations/woocommerce-plugin/woocommerce-user-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
