Magento 2 Integration Guide
Integration with Magento 2 address forms made simple
A step-by-step guide to integration with Magento 2 address forms.
New Plugin
You can now use all of our main products in a single Magento 2 plugin! The new plugin allows you to use Address Auto-Complete, UK Postcode Lookup, Phone Validation, and Email Validation.
If you are still using one of our stand-alone plugins, please follow this guide to switch to the new plugin when you're ready. If you have any questions please contact support.
Preparation
Compatibility
Our current release supports the latest version of Magento (v2.4.x at the time of writing), on both Community and Enterprise Edition.
Download
We recommended using Composer to pull our plugin directly into your Magento 2 website, but you can also download it from our website.
Composer
Require the package
Add the latest version of our plugin with the following command. You may be prompted to enter your Magento 2 access keys - the username is your public key and the password is your private key.
composer require fetchify/module-fetchify
Now sign up for a Fetchify account if you haven't already done so, then proceed to installation.
Manual Download
- Download our extension.
- Create this folder structure in your Magento root:
/app/code/Fetchify/Fetchify
. - Upload the contents of the extension (etc, Helper, Model, and so on) into the module-fetchify folder you just created.
Now sign up for a Fetchify account if you haven't already done so, then proceed to installation.
Installation
Please note that executing these lines will cause downtime on your Magento store until they finish.
php bin/magento setup:upgrade
php bin/magento setup:di:compile
The plugin should now be successfully installed. Login to your Magento 2 admin area and configure the plugin.
Configuration
First of all, set your access token at Stores > Configuration > Fetchify > Main Settings
.
Then decide which product(s) you want to use and make sure they are enabled. Each product has its own dedicated configuration area where you can enable it and set various options.
Stores > Configuration > Fetchify > Address Auto-Complete
Stores > Configuration > Fetchify > UK Postcode Lookup
Stores > Configuration > Fetchify > Phone Validation
Stores > Configuration > Fetchify > Email Validation
After you set your access token and enable some products, you will be able to use them on any standard Magento 2 address form.
Changing County Type
With our Postcode Lookup product, you are able to either disable counties, use former postal counties, or use traditional counties. By default, our Postcode Lookup product uses traditional counties.
You can change this by configuring the County Data
configuration option.
This configuration option can be found in Stores > Configuration > Fetchify > UK Postcode Lookup
under the Advanced
section.
Configuration Options
The configuration for the plugin is located under Stores > Configuration > Fetchify
. There are 5 sub-sections with configurations included.
Main Settings
Main Options
Configuration Option | Description |
---|---|
Enable Extension | Activate module |
Access Token | Access token |
Address Auto-Complete
Address Auto-Complete Options
Configuration Option | Description |
---|---|
Enable | Activate product |
Style Settings
Configuration Option | Description |
---|---|
Mode | Currently only one default mode available |
Ambient | The main theme colour of the user interface |
Accent | The secondary colour of the user interface |
Text Options
Configuration Option | Description |
---|---|
Search Label | Default label for the search input field |
Search Placeholder | Default text for the search input field |
Placeholder for Country Selection | Default text for the country selecting step |
Change Country button text | Default text for the change country button |
No Results Message | Message if no results can be found |
Generic Error Message | Default error message |
Text for Toggle Button | Default field revealing text when fields are hidden |
Advanced
Configuration Option | Description |
---|---|
Transliterate for non-ASCII characters | Changes non-Latin characters to Latin characters |
Hide Address Fields | Hide address fields until address is selected |
Lock country selection | Changes the modules country to the one that is currently selected |
Set custom ID for the parent element of the search bar | Add ID for customisation purposes |
Use first address line for search | Address search uses Address Line 1 instead of a new element |
Enable debug tools | Enable debug tools for debugging purposes |
Exclude PO Boxes | Exclude PO Box addresses from search results |
Exclude Areas | Use predefined options to exclude regions from search resul |
UK Postcode Lookup
Postcode Lookup Options
Configuration Option | Description |
---|---|
Enable | Activate product |
Search Options
Configuration Option | Description |
---|---|
Hide Address Fields of New Address Entry | Hides the address fields until an address is being selected from the dropdown list, or the fields are already populated |
Message Options
Configuration Option | Description |
---|---|
Search Label | Default label for the search input field |
Search Placeholder | Default text for the search input field |
Button Text | Default text for the search button |
Text for Manual Entry Button | Text for the reveal fields button |
Error Msg #1 | Default error message if a postcode cannot be found |
Error Msg #2 | Default error message if a postcode is not valid |
Error Msg #3 | Default error message if unable to connect to the address lookup server |
Error Msg #4 | Default error message if an unexpected error occurs |
Advanced
Configuration Option | Description |
---|---|
County Data | Select from traditional county names, postal county names, or an empty county field |
Phone Validation
Phone Validation Options
Configuration Option | Description |
---|---|
Enable | Activate product |
Email Validation
Email Validation Options
Configuration Option | Description |
---|---|
Enable | Activate product |
Questions
- Do you offer support? Yes, we do offer support during normal business hours in the UK. If you run into any issues, let us know and we will be happy to help.
- Is this free? The extension is free to download and try, but to use it on a live site you will need a paid account with us.
- Do I need to sign up for an account to try it? Yes, you’ll need a trial account, at least. You can easily sign up for a free trial account.