Hot answers tagged

95

Stores > Settings > Configuration > Advanced > Admin > Security > Admin Session Lifetime (seconds) Also, there is a possibility to set this parameter directly to the database, just put a value under the path admin/security/session_lifetime in the table core_config_data Update Magento 2.1 admin cookie life time = Stores > Settings > ...


32

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.


29

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', ), Now your value is http://127.0.0.1/magento2.1/admin Remove cache and check in your browser.


28

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 configuration file. (mageworx_collect as the example): app/code/MageWorx/AlsoBought/etc/adminhtml/system.xml <?xml version="1.0"?> <!-- /** * ...


21

You can find Interface Locale from admin to upper right corner admin dropdown have menu Account Setting


20

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.


18

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: Where <magento_root> is the path of your Magento installation. Update: As @matinict said, above solution is not a permanent solution. So below is the ...


17

To answer your question: add this to local.xml: <default> <reference name="head"> <block type="cms/block" name="google_plus" as="google_plus"> <action method="setBlockId"><block_id>google_plus</block_id></action> </block> </reference> </default> Now create a cms ...


16

Personally I would go for a layout/action approach using the addTab() provided by Mage_Adminhtml_Block_Widget_Tabs So 2 main action are involved here: add XML layout changes create the tab class ( all this can be accomplish creating a new module, out of the scope here ) -- 1. Layout changes -- <?xml version="1.0"?> <layout> <...


14

In your collection class (/Some/Module/Model/Mysql4 (or Resource)/YourModel/Collection.php) add this method: public function addProductData() { /** add particular attribute code to this array */ $productAttributes = array('name', 'price', 'url_key'); foreach ($productAttributes as $attributeCode) { $alias = $...


13

and now it is possible :) https://github.com/ProxiBlue/jumptocatid (felt like something quick to work on before shut eye) This places an input box above the category tree in admin, and allows you to jump to any category id entered. Largely untested, so please adjust as needed


12

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 relevant code is in Magento\Backend\Model\Session\AdminConfig: /** * Set session cookie lifetime to session duration * * @return $this */ protected function ...


12

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 entire files and folder under pub/static except .htaccess


11

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 $systemStore ) { //... $this->_systemStore = $systemStore; } protected function _prepareForm() { //... $fieldset->addField( 'store_ids', ...


10

In the Magento backend, browse to Catalog -> URL Rewrite Management. On this page you can search on ID Path. If you just type category/* where * is your category id, the request path will show you the category name.


10

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 handled by this js file lib/web/mage/backend/form.js where a jquery ui widget is created. These are the options for the widget options: { handlersData: { ...


10

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->getEvent()->getOrder(); $history = $order->addStatusHistoryComment($order->getShippingMethod(), false); $history->setIsCustomerNotified(false);...


10

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 carefully. Open table eav_attribute and find attribute_code street and get attribute_id from it (generally attribute_id is 28). Open table ...


9

maybe this helps: The Two Level cache mechanisms The « two level cache » system allows to get a fast cache backend and a slow cache backend. The main problem here is that only file and database structures allow the slow backend to be really efficient because a “home made” structuring of these content can be done. With APC or Memcached, we ...


9

I'm given example here of how to extend the sales order view page. Like this, you can extend any module which one you want. Follow the Below Steps Step 1) Enable the extension to specify the config.php file from the app/etc folder <?php return array ( 'modules' => array ( 'Learning_RewriteSales' => 1, ), ); Step 2) Create Custom.php ...


8

If it is enough for you to make it not editable in product management, use the frontend input type label, which replaces the form input with plain text: addAttribute($entity, $code, array( ... 'input' => 'label', ... )); Note that this will not prevent saving the attribute through API or manipulated POST request. To make it secure, ...


8

Try this.. In you block-form $fieldset->addField('file', 'file', array( 'label' => Mage::helper('foundation')->__('CSV'), 'class' => 'disable', 'required' => true, 'name' => 'file', )); And in your controller public function saveAction() { if ($data = $...


8

Magento has a security measure against CSRF attaks. Each admin url must have a key parameter which is built from the url of the page and a random string generated each time you log in. To get the url for your page (including the key) you need to call this Mage::helper('adminhtml')->getUrl('adminhtml/framexport/index'). But you can disable this ...


8

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/sessionclean ] && /usr/lib/php/sessionclean then this is added to the system cron by the php installation. So then you can either disable that cron or ...


8

Try to use: echo $block->getViewFileUrl('Company_Helloworld::yourImage.png'); As a second argument of \Magento\Framework\View\Element\AbstractBlock::getViewFileUrl($fileId, array $params = []) you can set an array of next parameters: "module", "_secure", "theme", "area" and "locale"


8

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 Remove var/view_preprocessed run php bin/magento setup:static-content:deploy


7

You can use following code directly in your phtml file to get admin URL. echo $this->helper('Magento\Backend\Helper\Data')->getHomePageUrl();


7

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 downloadable:domains:add www.xyz.com In order to get all whitelisted domains bin/magento downloadable:domains:show In order to remove a domain from whtielist ...


7

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 still think Magento should return a 404 or some other error message that would be much more helpful to debug but in this case that was all I did wrong.


6

I suggest you follow these steps to learn magento from you background Learn HTML/JS/CSS: this will be used for front end development or any UI customization in client side so that you must expertise these things before doing anything Learn PHP: at least you build your own PHP simple app from beginning to understand some basic feature. For example: you can ...


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