Type
magento2-module
Address Autocomplete for your Magento 2 store by AddressFinder
magento2-module
OSL-3.0, AFL-3.0
None
None
None
None
None
su www-data
composer require addressfinder/module-magento2
bin/magento module:enable AddressFinder_AddressFinder
bin/magento setup:upgrade
bin/magento cache:flush
AddressFinder/AddressFinder
in app/code
.bin/magento module:enable AddressFinder_AddressFinder
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
bin/magento cache:flush
su www-data
composer update
cd /var/www/html/bin && ./magento cache:clean && ./magento cache:flush && ./magento setup:upgrade && ./magento setup:di:compile && ./magento setup:static-content:deploy -f en_GB en_US
We test the plugin by using docker images for Magento 2. We install the plugin inside this test store.
Clone the image for the version of Magento you want to use.
For Magento 2.3.2
git clone --branch 2.3.2.0 [email protected]:AbleTech/docker-magento2.git docker-magento-2.3.2 && cd docker-magento-2.3.2
For Magento 2.3.1
git clone --branch 2.3.1.0 [email protected]:AbleTech/docker-magento2.git docker-magento-2.3.1 && cd docker-magento-2.3.1
For Magento 2.3
git clone --branch 2.3 [email protected]:AbleTech/docker-magento2.git docker-magento-2.3 && cd docker-magento-2.3
For Magento 2.2
git clone --branch 2.2 [email protected]:AbleTech/docker-magento2.git docker-magento-2.2 && cd docker-magento-2.2
For Magento 2.1
git clone --branch 2.1 [email protected]:AbleTech/docker-magento2.git docker-magento-2.1 && cd docker-magento-2.1
For Magento 2.0
git clone --branch 2.0 [email protected]:AbleTech/docker-magento2.git docker-magento-2.0 && cd docker-magento-2.0
Install Magento
docker-compose exec web install-magento
In a new tab, edit your host file to redirect localhost to local.magento
to open the file: sudo vim /etc/hosts
add: 127.0.0.1 local.magento
Open your browser at:
Shop pages: http://local.magento/index.php/
You can login to the admin using the credentials MAGENTO_ADMIN_USERNAME and MAGENTO_ADMIN_PASSWORD from the env file inside your docker container.
If you make a mistake and need to start again you can remove docker images and volumes with this command docker-compose down --rmi all -v
You will need to install a product in your store to use the checkout and test the AddressFinder plugin
This plugin is made up of two parts. 1. The Magento plugin, which provides the specific configuration for Magento, and connects to a Magento store 2. AddressFinder Webpage Tools. This is an NPM package that adds the autocomplete capability. https://github.com/abletech/addressfinder-webpage-tools
To make changes to addressfinder-webpage-tools npm package, you will need to copy and paste the file inside the addressfinder-webpage-tools.js file in the source directory. Magento doesn't have support for npm, so we can't include the package in the normal way.
To build the plugin
1. npm install
2. npm run build
or npm run build:production
if you want the file minified. These files will be added/updated inside the /view/frontend/layout/web/js folder.
(These instructions assume you already have Magento and AddressFinder installed.)
- /[PATH TO ADDRESSFINDER MAGENTO]/addressfinder-magento/view/frontend:/var/www/html/vendor/addressfinder/module-magento2/view/frontend
into the docker-compose.yml file, under web volumes. This will add the frontend folder from your addressfinder-magento project into the addressfinder extension folder inside your docker container. You can find the path by navigating to the addressfinder magento folder and typing the command pwd
For example:
version: '3.0'
services:
web:
image: alexcheng/magento2:2.2
volumes:
- web-data-test:/var/www/html
- /Users/katenorquay/addressfinder/addressfinder-magento/view/frontend:/var/www/html/vendor/addressfinder/module-magento2/view/frontend
docker-compose up
docker-compose exec web bash
cd /var/www/html/bin && ./magento cache:clean && ./magento cache:flush && ./magento setup:upgrade && ./magento setup:di:compile && ./magento setup:static-content:deploy -f en_GB en_US
cd .. && chmod 0777 -R var/cache
rm -rf /var/www/html/pub/static/frontend/Magento/luma/en_GB/AddressFinder_AddressFinder/js
ln -s /var/www/html/vendor/addressfinder/module-magento2/view/frontend/web/js /var/www/html/pub/static/frontend/Magento/luma/en_GB/AddressFinder_AddressFinder/js
npm run watch
. Any further changes you make to the src folder will be watched and recompiled by webpack.The Magento plugin is deployed in two ways - through Composer and through the Magento MarketPlace. For both, create a release and update the version number in all the necessary files: - composer.json - module.xml - package.json and package-lock.json - magento_plugin.js
Add an entry to CHANGELOG.md, describing the change
run npm run build:production
to compile the js.
For a composer deploy, simply push a new git tag to the master branch, after you have merged your changes. This tag will be picked up and deployed automatically.
git tag 1.1.3
git push --tags origin master
For a Magento Marketplace deploy you need to create a zip package for distribution. Run bash package.sh
. You will be prompted to enter the version
number of your new release. Once you enter it, a file named something like 'addressfinder_addressfinder-1.1.5.zip' will be created in this directory.
This file can be uploaded to the Magento Marketplace by Matt, who will add all the necessary release information.
You may run into permissions issues. You can give read/write permissions for all files using: chmod 0777 -R .