---- dataentry integration ---- type : integration # do not change this line supports-foxycart-version-from : 2.0 # Minimum required FoxyCart version for this to work supports-foxycart-version-to : # Last FoxyCart version that supports this (leave empty if unknown) systems : loqate # the system(s) that the integration is for, separated with commas if more than one name : Loqate # the name of the integration description : Add Loqate address lookup and validation to your checkout tags_tags : address lookup, address validation # tags, separated by commas. don't include the "system" here. date_dt : 2021-01-20 # the date in YYYY-MM-DD format version : 1.0 # if you have a version for your code, enter it here developer_url : https://www.loqate.com # if you'd like a link back to your site, stick it here ---- ====== Loqate Address Validation ====== The following integration adds address autocompletion and validation using Loqate, with support for over 245 countries. ===== Requirements ===== * Foxy 2.0 * [[https://www.loqate.com|Loqate account]] ===== Installation ===== ==== Step 1: Signup with Loqate ==== This integration requires an account with Loqate, which you can sign up for on their website at https://www.loqate.com ==== Step 2: Add custom code ==== In your store's FoxyCart administration, proceed to the "configuration" section. If it's not already enabled, enable the option labelled "Add custom header and footer code to your templates". Then, within the "footer" textarea, paste the following code: {% if context == "checkout" %} {% endif %} ==== Step 3: Customise code ==== At the top of the code, you'll need to update the following line with your own API Key from your Loqate account: var _LOQATE_API_KEY = "XX11-XX11-XX11-XX11"; You can get this API key by creating a service for your Foxy checkout within your Loqate account. To do that: - In the Loqate account administration, click the "Add Service" button in the top right - In the options for adding a new service, select "API Key" from the bottom row of the options - This will load a page with your new service. - Go to the "Configuration" tab and give it a name (like "Foxy Checkout" for example). - Go to the "Limits" tab and under "Limit by URL", enter your Foxy store subdomain. That will look like ''https://yourstore.foxycart.com'', or if you're using a custom subdomain, whatever you've configured as the custom store subdomain. - Press the "Save" button after configuring any other options as desired. - Back on the "Configuration" tab, copy the "Key" from the top of the panel, this is what you'll need to set on the API key as noted above. ==== Step 4: Turn off native postcode lookup ==== As the new integration will take care of auto-filling the customers address, the normal postcode lookup functionality isn't needed, and can cause conflicts when enabled. To turn that off, within the "configuration" section of the Foxy administration, uncheck the checkbox for "Enable city and region lookup by postal code" ==== Step 6: Save and test! ==== After you've made all of the modifications to your store's configuration in the Foxy administration, save the configuration. Now you're ready to test! Add a product to your cart, head to the checkout and you should see the address auto-complete as you type.