How to install the Shipping Costs Based on Distance extension using Composer
Step-by-Step Installation of Magento 2 Extensions via Composer
Important: If the plugin was purchased from the Adobe Marketplace, this installation method does not apply. The steps outlined below are only for orders placed directly via our site.
Installing Magento extensions using Composer is the preferred method due to its ability to manage dependencies, ensure version compatibility, and streamline the update process. Composer simplifies the installation and management of PHP packages, making it an essential tool for Magento development.
Get the Details
-
Log in to your account to obtain your Composer Authentication Keys and Credentials, which are automatically generated after purchasing one of our extensions.
-
You can also create new Composer keys with a description if you want to change environments and keys.
Backup (Optional but Recommended)
We strongly recommend testing your installation in a development environment prior to releasing it to production. Additionally, ensure you have a full backup of your store available in case you need to perform a rollback.
Add the Magmodules Composer Repository via SSH
The next step is to add the packages.magmodules.eu repository to your Composer configuration.
Add Repository by SSH
Through an SSH connection, run the following command from your Magento installation directory to connect with our private repository:
composer config repositories.magmodules composer https://packages.magmodules.eu/
After executing this command, a blank line will appear, indicating that the repository has been successfully added to your composer.json file.
If you prefer to add the Composer repository manually, please refer to your account for the exact commands.
Install and Activate the Extension via Composer
Once the Magmodules repository has been added to your composer.json, you can install any packages available through it. If preferred, you may enable maintenance mode before continuing.
Download Extension
To download the extension into your Magento installation, run the following command from the Magento root directory:
composer require magmodules/magento2-distance-based-shipping
If no Composer authentication keys are configured yet, you will be prompted to enter the username and password. These Composer Auth Keys can be obtained from your Magmodules account: Magmodules Auth Keys
Install Extension
After the extension has been downloaded, install and activate the Shipping Costs Based on Distance extension by executing the following commands:
php bin/magento module:enable
php bin/magento setup:upgrade
If your Magento store is running in production mode, you must recompile and deploy static content:
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
It is recommended to clear the Magento cache after installation:
php bin/magento cache:flush
Once these commands have been executed successfully, the extension is installed and ready for configuration. You can now configure the extension via: Stores → Configuration → Magmodules → Shipping Costs Based on Distance
Update or Remove the Extension via Composer
Once the extension is installed via Composer, you can easily update it, switch to a specific version, or remove it entirely. Composer ensures that dependencies are handled correctly, making updates safe and consistent across your Magento installation.
Update to the Latest Version
composer update magmodules/magento2-distance-based-shipping
Update to a Specific Version
composer require magmodules/magento2-distance-based-shipping:x.y.z
Remove the Extension
composer remove magmodules/magento2-distance-based-shipping
After updating or removing an extension, run the following commands:
php bin/magento setup:upgrade
php bin/magento cache:flush
If you are in production mode, also execute:
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f