Manage third-party extensions
Code that extends or customizes ۶Ƶ Commerce behavior is called an extension. You can optionally package and distribute extensions on the or another extension distribution system.
Extensions include:
- Modules (extend ۶Ƶ Commerce capabilities)
- Themes (change the look and feel of your storefront and Admin)
- Language packages (localize the storefront and Admin)
This topic explains how to use the command-line interface to manage third-party extensions that you purchase from the Commerce Marketplace for on-premises projects. For cloud infrastructure projects, see Manage extensions.
You can use the same procedure to install any extension; all you need is the extension’s Composer name and version. To find it, open the extension’s composer.json
file and note the values for "name"
and "version"
.
Install
Before installation, you may want to:
-
Back up your database.
-
Enable maintenance mode:
code language-bash bin/magento maintenance:enable
To install an extension, you must:
-
Get an extension from the Commerce Marketplace or another extension developer.
-
If you install an extension from the Commerce Marketplace, make sure that the
repo.magento.com
repository exists in yourcomposer.json
file:code language-bash "repositories": [ { "type": "composer", "url": "https://repo.magento.com/" } ]
-
Get the extension’s Composer name and version.
-
Update the
composer.json
file in your project with the name and version of the extension. -
Verify that the extension installed properly.
-
Enable and configure the extension.
Get extension information
If you already know the extension’s Composer name and version, skip this step and continue with Update your composer.json
file.
To get the extension’s Composer name and version from the Commerce Marketplace:
-
Log in to with the username and password you used to purchase the extension.
-
In the upper-right corner, click Your name > My Profile.
-
Click My Purchases.
-
Find the extension that you want to install and make a note of the component name and version.
composer.json
file.Update Composer dependencies
Add the extension’s name and version to your composer.json
file:
-
Navigate to your project directory and update your
composer.json
file.code language-bash composer require <component-name>:<version>
For example,
code language-bash composer require j2t/module-payplug:2.0.2
-
Enter your authentication keys. Your public key is your username; your private key is your password.
-
Wait for Composer to finish updating your project dependencies and make sure that there aren’t any errors:
code language-none Updating dependencies (including require-dev) Package operations: 1 install, 0 updates, 0 removals - Installing j2t/module-payplug (2.0.2): Downloading (100%) Writing lock file Generating autoload files
Verify installation
To verify that the extension installed properly, run the following command:
bin/magento module:status J2t_Payplug
By default, the extension is probably disabled:
Module is disabled
The extension name is in the format <VendorName>_<ComponentName>
; this is a different format from the Composer name. Use this format to enable the extension. If you are unsure of the extension name, run:
bin/magento module:status
And look for the extension under “List of disabled modules”.
Enable
Some extensions don’t work properly unless you clear generated static view files first. Use the --clear-static-content
option to clear static view files when you’re enabling an extension.
-
Enable the extension and clear static view files:
code language-bash bin/magento module:enable J2t_Payplug --clear-static-content
You should see the following output:
code language-none The following modules have been enabled: - J2t_Payplug To make sure that the enabled modules are properly registered, run 'setup:upgrade'. Cache cleared successfully. Generated classes cleared successfully. Please run the 'setup:di:compile' command to generate classes. Generated static view files cleared successfully.
-
Register the extension:
code language-bash bin/magento setup:upgrade
-
Recompile your project: In Production mode, you may receive a message to “Please rerun Magento compile command”. The application does not prompt you to run the compile command in Developer mode.
code language-bash bin/magento setup:di:compile
-
Verify that the extension is enabled:
code language-bash bin/magento module:status J2t_Payplug
You should see output verifying that the extension is no longer disabled:
code language-none Module is enabled
-
Clean the cache:
code language-bash bin/magento cache:clean
-
Configure the extension in Admin as needed.
bin/magento cache:flush
.Upgrade
To update or upgrade a module or extension:
-
Download the updated file from Marketplace or another extension developer. Take note of the module name and version.
-
Export the contents to your application root directory.
-
If a Composer package exists for the module, run one of the following.
Update per module name:
code language-bash composer update vendor/module-name
Update per version:
code language-bash composer require vendor/module-name ^x.x.x
-
Run the following commands to upgrade, deploy, and clean the cache.
code language-bash bin/magento setup:upgrade --keep-generated
code language-bash bin/magento setup:static-content:deploy
code language-bash bin/magento cache:clean
Uninstall
You should contact the extension vendor for instructions to remove a third-party extension. The instructions should provide the following information:
- How to revert database table changes
- How to revert database data changes
- Which files should be removed or reverted
The following instructions provide general information for uninstalling third-party extensions:
-
Remove the extension from your ۶Ƶ Commerce project repository.
-
For Composer-based extensions, remove the extension from your ۶Ƶ Commerce
composer.json
file.code language-bash composer remove <component-name>
-
For non-Composer-based extensions, remove the physical files from your ۶Ƶ Commerce project repository.
code language-bash rm -rf app/code/<vendor-name>/<component-name>
-
-
If the
config.php
file is under source control in your ۶Ƶ Commerce project repository, remove the extension from theconfig.php
file. -
Test your local database to ensure that the vendor-provided instructions work as expected.
-
Verify that the extension is properly disabled and that your website works as expected on your staging environment.
-
Deploy the changes to your production environment.