Skip to main content
36 votes
Accepted

Magento 2: How to retrieve admin URI?

You can get it from app/etc/env.php file, You have to get frontname from this file and suffix in your base url. 'backend' => array ( 'frontName' => 'admin', ), Or php bin/magento info:...
Rakesh Jesadiya's user avatar
36 votes

Magento 2: How to retrieve admin URI?

You can get the details by below command in you Magento 2 instance. php bin/magento info:adminuri you can get the result like Admin URI : /kqasuydi Hope this is the simple and quick way to get.
Krishna ijjada's user avatar
30 votes

How to create a button in Magento 2 configuration section?

We will describe the solution using our Others Also Bought module as the example, where MageWorx – a vendor name and AlsoBought – a module name: First, you need to add your button as a field in the ...
Mageworx's user avatar
  • 3,566
21 votes
Accepted

Magento 2 - How do I change the locale of admin backend?

You can find Interface Locale from admin to upper right corner admin dropdown have menu Account Setting
Prashant Valanda's user avatar
20 votes

Magento 2 backend session timeout

Check attached image screenshot for better understanding of admin process. Go to Stores->Settings->Configuration->Advanced->Admin->Security->Admin Session Lifetime (seconds) And check screenshot.
Yogesh Trivedi's user avatar
19 votes
Accepted

How to change default logo of magento admin panel

There is no setting to change Magento's backend logo. If you want, you can change it by replacing at: <magento_root>/pub/static/adminhtml/Magento/backend/en_US/images/magento-logo.svg Note: ...
Mohit Kumar Arora's user avatar
14 votes

Magento 2 backend session timeout

Solution for Magento 2.1+ Since Magento 2.1 the admin session lifetime is always "session", i.e. until the browser is closed. This has been might have been introduced for security reasons. The ...
Fabian Schmengler's user avatar
12 votes

admin backend icon fonts missing

Open up app/etc/di.xml find the path Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink and replace it with Magento\Framework\App\View\Asset\MaterializationStrategy\Copy Note: Remove ...
Subhranil Jana's user avatar
12 votes
Accepted

Magento 2 - add Multiselect Store Views in admin Form

You should inject class Magento\Store\Model\System\Store in the constructor and declare a global variable. E.g: public function __construct( //..., Magento\Store\Model\System\Store $...
LinoPham's user avatar
  • 3,778
11 votes
Accepted

Add Custom Validation Street Address Field in backend Magento 2

You Can do it by Script and update validation within it.You have to change 'validate_rules' => '{"max_text_length":255,"min_text_length":5}', You can change it directly from DB you have to do it ...
Ketan Borada's user avatar
  • 2,633
10 votes
Accepted

About Magento2 backend form button "Save", "SaveAndContinue"

I don't have a full explanation, but I have an idea. All elements rendered with mage-init will/should be handled by some javascript code. You are linking these buttons to a form, and the form is ...
Marius's user avatar
  • 198k
10 votes
Accepted

How to automatically add a comment on order when is placed

You'll want to create an event-observer module & observe sales_order_place_after. Your observer method would look like this: public function logShipping($observer){ $order = $observer->...
Moose's user avatar
  • 7,495
9 votes
Accepted

Magento 2.3.2 throws DOMXPath exception in backend ("Stores > Configuration") after upgrade from 2.2.7

This issue might be generated due to wrong XML configuration. Kindly check your customize module and third-party module. Check di.xml, events.xml,system.xml and router.xml file in your modules.
Arunprabakaran M's user avatar
9 votes

Link URL's domain is not in list of downloadable_domains in env.php

Magento has added this feature in latest 2.3.3 You have to whitelist the domains of those links through ssh in order to save them. To add a domain you have to run this command : bin/magento ...
Afreen Sheikh's user avatar
8 votes

Magento 2 backend session timeout

A note here, the accepted answer works however magento 2 uses the default php folder to store session files, if you have this configured in php: 09,39 * * * * root [ -x /usr/lib/php/...
OZZIE's user avatar
  • 552
8 votes
Accepted

admin backend icon fonts missing

It seems that some css and fonts files are not generated properly. You need to do the folowing Remove pub/static Remove var/cache Remove var/composer_home Remove var/generation Remove var/page_cache ...
Shaheer Ali's user avatar
  • 2,355
8 votes
Accepted

How to get admin side base url in magento 2?

You can use following code directly in your phtml file to get admin URL. echo $this->helper('Magento\Backend\Helper\Data')->getHomePageUrl();
Dinesh Yadav's user avatar
  • 6,465
8 votes

Magento 2: Get root category ID programmatically in backend

Use \Magento\Store\Model\StoreManagerInterface class to get store default root category Id. <?php class Test { /** * @var \Magento\Store\Model\StoreManagerInterface */ protected $...
Priyank's user avatar
  • 7,702
7 votes
Accepted

Magento 2.3.5 Custom Module "Invalid security or form key. Please refresh the page"

In this case, I was accessing the wrong route, rather than /adminurl/vendor_module/store/ which caused the error message about an invalid key, I needed to go to /adminurl/vendor_module/store/index/. I ...
joeybab3's user avatar
  • 378
6 votes
Accepted

magento2: admin grid showing joined table

I created admin grid which has join of two custom tables. you cannot do this by using virtual type is di.xml, so you need to follow these steps and update your etc/di.xml, Model/ResourceModel/...
Ekta Puri's user avatar
  • 1,116
6 votes
Accepted

Changing default product view per page in backend

Go to your /app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php Search the file for a line of code that reads: parent::__construct(); Once you find it, paste the below code on the line ...
Manashvi Birla's user avatar
6 votes

Template not found: 'include(): Filename cannot be empty' when viewing order details

The problem This is an error from PHP's include Warning: include(): Filename cannot be empty The filename passed to include is an empty string "". This is caused in app/code/core/Mage/Core/Block/...
7ochem's user avatar
  • 7,562
6 votes
Accepted

Magento 2.X : How can I add a new tab in the admin panel?

In your custom extension you need to create file in following place. Vendor\Extension\etc\adminhtml\menu.xml Add following code into file, <?xml version="1.0"?> <config xmlns:xsi="http://...
Dhiren Vasoya's user avatar
6 votes
Accepted

How to get Customer attribute value by loading customer id in magento 2

you can use this code to get customer attribute value. class MyClass { protected $_customer; protected $_customerFactory; public function __construct(... \...
HIren Kadivar's user avatar
5 votes

Magento 2 - How do I change the locale of admin backend?

Go to admin panel,click on, This is for frontend Locale Changes, Stores -> Configuration -> General Search Locale Options on that page. You have to go for Locale Option in that page. You can ...
Rakesh Jesadiya's user avatar
5 votes

Get URL of the static content folder (for backend)

Try to use: <?php class ... protected $_assetRepo; public function __construct( .... \Magento\Framework\View\Asset\Repository $assetRepo, .... ) { .... $this->_assetRepo = ...
Technocracker's user avatar
5 votes

How to Add A Widget Instance to Specific CMS Pages

As others have mentioned you cannot do this out of the box, however in Magento 2, you can add custom page types and individually add the pages you want to be able to insert widgets to, eg: Vendor/...
Javier Villanueva's user avatar
5 votes
Accepted

Implementing a custom Magento indexer in an extension

In order to declare an index you need to add this to config.xml inside the global tag: <index> <indexer> <some_unique_index_name_here> <...
Marius's user avatar
  • 198k
5 votes

How to change default logo of magento admin panel

Logo is coming up from magento2-base/setup/pub/images/magento-logo.svg .
Rushvi's user avatar
  • 2,843
5 votes
Accepted

Specifies invalid parent id (Magento Backend::mgs)

There is no any parent id name with mgs so it will throw error See below code is for page menu <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
Prashant Valanda's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible