Magento is one of their most popular eCommerce platforms that continues to release new versions with updates and bug fixes.
To keep up with the pace of your competition, benefit from new features, and keep your store safe, you have to update Magento regularly. However, to do that you should be aware of the version you currently use.
That said, there are several ways to check Magento version. In this article, we'll look into each of them in detail.
Post Contents [hide]
1. Check Magento version via Admin Panel
For starters, we can check Magento 2 version from the admin panel. To do that, log into your Magento admin panel and scroll down to the footer. You'll see your Magento version in the bottom right corner.
2. Check Magento version using CLI
Besides, you can check Magento version via the command line. To do this navigate to your Magento 2 root directory and run the following command:
php bin/magento --version
The result should be the following:
Magento CLI 2.4.6
3. Get Magento version programmatically
Here is another option for you to go for. You can check Magento version programmatically in the PHP code. For that, you need to have a ProductMetadataInterface object. You can define it in your PHP class constructor, e.g.:
private $productMetadata;
public function __construct(
...
\Magento\Framework\App\ProductMetadataInterface $productMetadata,
...
) {
$this->productMetadata = $productMetadata;
parent::__construct(...);
}
And then check the Magento version using $this->productMetadata object, e.g.:
$version = $this->productMetadata->getVersion();
You can also easily get the Magento edition, e.g. CE, EE, or ECE, using this code:
$edition = $this->productMetadata->getEdition();
4. Check Magento Version via URL
If you can't access the Magento website admin panel, CLI, or code, you can still try to check Magento version from the URL. You just need to add /magento_version to the base URL of your store:
https://magento2store.com/magento_version
Note: you need to replace "https://magento2store.com/" with the actual URL address of your store.
You'll get the following result, using this method.
5. Check Magento Version via Composer.json
Alternatively, you can find the current version and edition of your Magento in the composer.json file. The result may be similar to the following:
There you go! You can choose any of the listed options to check the version and edition of your Magento. Everything depends on what your assets are and how accurate the result you want to get.
Once you know what Magento version you operate, you can choose the best way to manage your website.