Page 4 - Magento 2 Development
The etc/adminhtml/menu.xml file is used to control the Magento 2 admin panel menu and add new items to it, in particular.
In the previous article we described how to create your own section on the Magento 2 configuration page (Stores > Configuration).
In the previous article we explained how to configure and delimitate access rights for the Magento 2 admin panel users. In this article, you will learn how to create your own access rules (Role Resources).
To find the Magento 2 configuration page navigate to Magento 2 Admin Panel > Stores > Configuration.
To add a new table to the Magento 2 database, you need to create a file in the module folder:
Since you already know how to create first controller in Magento 2 and to display the "Hello World" text on your own page, in this article we will show you how to display it in the new block.
To display "Hello World" on your own page in Magento 2, follow these steps:
To create basic Magento 2 module you need only 2 files: module.xml and registration.php.
As you create your eCommerce store, there are multiple stages you go through: starting with development and gradually moving to live. Each stage has corresponding tasks to keep your website running.
If you face an unexpected 301 or 302 redirect in Magento 2 and you don't know why it happens or what code causes it, you can easily find this out by temporarily editing the following files:
In case you work with a lot of different Magento instances as a temporary project you might want to have a nice method to check debug backtrace of some function execution in Magento 2 quickly without installing or enabling additional software on the server, e.g. Xdebug.
When a visitor scrolls the web-page down It is convenient to display a button that will allow easily, by a one-click move customer back to the top of the page.
The sortOrder property for plugins in Magento 2 determines when to call them (before, after, or around a method), on condition more than one plugin is configured for the same method.
If you don't want to reindex Magento 2 from admin panel, the other way is to run reindex via CLI.
If you have a product attribute and want to assign it to a single attribute set, it's easy to do via Magento 2 Admin Panel > Stores > Attributes > Attribute Set.
But what if you need to assign it to all your attribute sets? What if you have 50+ or ever 100+ attribute sets? It can be time costly.
Have you ever wondered how easy it is to check the quality of your own code, your colleagues' code, or a third-party module you want to use on a Magento project?
Imagine you are cooking pasta and sit down to play some game. You listen with one ear to see if the "dish" does not boil away. In this case, you are an observer. When the pasta starts to boil away — the event "pasta_began_to_boil_away" is triggered, which causes you (the observer) to rush to the kitchen (perform an action, an algorithm).
You often need to change the JavaScript code logic located in the .js file. The easiest way is to override the js file is by using a theme. You can learn how to override view files in the article about Overriding Magento 2 Storeftont Files. This is a quick but not an elegant way.
All PHP programmers are familiar with the superglobal variables such as $_GET, $_REQUEST, $_POST, but their direct use is not allowed according to Magento2 code standards. So don't use them in your Magento 2 projects, especially if you want to pass the code Technical Review on the Magento Marketplace.