How to Check the Magento Version?
Magento is a renowned e-commerce platform, widely used globally. Staying updated with the latest Magento versions is crucial for maintaining security and accessing new features. Here are eight methods to check your Magento version:
1. Check Magento Admin Dashboard
The simplest way to check your Magento version is through the Admin Panel:
- Magento 1: Log in to your Admin Panel and scroll down to the bottom.
- Magento 2: If you have customized the dashboard, navigate to
System > Web Setup Wizard > System Upgrade
. Enter your private and public keys to view the version.
2. Check the composer.json
File (Only for Magento 2)
For Magento 2, the version can be found in the root composer.json
file. Look at line #5 for the version information:
jsonCode kopiëren{
"name": "magento/magento2ce",
"description": "Magento 2 (Open Source)",
"type": "project",
"version": "2.2.6-dev",
"license": [
"OSL-3.0",
"AFL-3.0"
],
…
}
3. Check the composer.lock
File (Only for Magento 2)
Similarly, the composer.lock
file in the root directory contains the version information at line #3:
jsonCode kopiëren{
"name": "magento/magento2-base",
"version": "2.3.1",
"dist": {
"type": "zip",
"url": "https://repo.magento.com/archives/magento/magento2-base/magento-magento2-base-2.3.1.0.zip",
"reference": null,
"shasum": "7877828bb63a7cfca5c62c6c6caf6a9c05ab154b"
}
}
4. Check via Command Line (Only for Magento 2)
To check the Magento version using the command line, run the following command:
bashCode kopiërenphp bin/magento --version
To determine if your Magento version is an enterprise or community edition, use:
bashCode kopiërencomposer licenses | grep Name:
5. Use Chrome Extensions
Two Chrome extensions can help you identify your Magento version:
- Wappalyzer: Detects if your store is on Magento 1 or Magento 2.
- Version Check for Magento: A paid tool for checking the Magento version.
6. Check Using PHP Code
- For Magento 1: phpCode kopiëren
Mage::getVersion(); // Returns the Magento version
- For Magento 2.0.X: phpCode kopiëren
echo \Magento\Framework\AppInterface::VERSION;
- For Magento 2.1.x to 2.3.x: Using Dependency Injection:phpCode kopiëren
public function __construct( \Magento\Framework\App\ProductMetadataInterface $productMetadata ) { $this->productMetadata = $productMetadata; } public function getMagentoVersion() { return $this->productMetadata->getVersion(); }
Using Object Manager:phpCode kopiëren$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $productMetadata = $objectManager->get('Magento\Framework\App\ProductMetadataInterface'); echo $productMetadata->getVersion();
7. Using Online Tools
You can use online tools like the Magento Version Checking Tool. Simply enter your store URL to check the Magento version.
8. Check from the URL
Add /magento_version
after your store URL to check your Magento version.
Keeping your Magento version updated is essential for security and leveraging new features. We hope these methods help you easily check your Magento version and stay current with updates.