Am I missing something or does Magento not provide any documentation about the core/default modules it uses?
Let's use an example: say I want to create a module which incorporates various core functions of Magento including:
- Presenting a log in or registration form to the customer allowing them to log in
- After logging in, displaying their complete order history including all items
Magento's DevDocs website roughly covers how to architect and set up a module using the folder structure and various XML files etc. but what it doesn't seem to provide is a full and complete documentation of the actual functions and methods used by each core module or how to use them to achieve even basic tasks like the examples I listed above.
There is a module reference but it's extremely basic and does not detail any code.
So... how are developers expected to know how to achieve anything? Are they simply expected to search the source code and "learn by example"? Does that mean developers need to first install the demo data in order to see how such actions are taken in PHTML files?
At the moment I basically rely on web searches and StackOverflow as a reference to achieve virtually everything in Magento. Using my example from above, I would search magento 2 log in customer programatically
and would find an answer such as this one which provides the code needed to authenticate a customer:
$customer = $this->customerAccountManagement->authenticate($login['username'], $login['password']);
$this->session->setCustomerDataAsLoggedIn($customer);
$this->session->regenerateId();
Why is there not official documentation which describes in detail the process of authenticating a customer, logging in, etc.? And where is the documentation which tells us exactly what the setCustomerDataAsLoggedIn()
and regenerateId()
functions actually do? Or even a basic list of functions/methods available for each object?
Next, if I want to learn how to list all orders by a customer, I'd search for magento 2 list all customer orders
, find a code snippet on this website, see which dependency/class I need to add to my module and which function will actually list a customer's orders.
Why is there not somewhere in Magento's official documentation which lists these kind of basic, essential, fundamental workflows which almost every developer will encounter at some point?
The only "technical" documentation I've been able to find is this site but there's no indication of where that came from; I assume it's been auto-generated from the Magento 2 source code and is not "official".
In my opinion this is a critical failing of Magento. When you have posts being made like How to create a module? because the official Magento documentation wasn't detailed enough, and the only answer links to a blog post by someone like Alan Storm instead of official Magento documentation, then surely that indicates a problem?
Why does Magento development need to be this way? Why is it like a giant puzzle which developers must solve either by delving through the source code or posting extremely specific questions on sites like this?