6

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:

  1. Presenting a log in or registration form to the customer allowing them to log in
  2. 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?

  • 2
    "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?" -- a question I've asked as well... except laced with more profanities... – Greg Nickoloff Feb 19 at 15:29
  • 1
    @GregNickoloff Plenty of profanity here as well, but I used all my willpower to keep it out of this post. – WackGet Feb 21 at 3:07
1

It seems you already answered your own question. You can't find detailed official documentation.

You already found the tools that help us all, stack overflow and Alan Storm's blog. this might also help with your frontend troubles a bit https://packagist.org/packages/msp/devtools

Now for the "Why does magento development need to be this way?" Well the people at Magento are smart and they prioritise you having a job in the long run over having fun at your job. So to do that they made sure that you can't learn the system without a lot of investment time wise. Never ever will a client tell you again "Well my 12 year old nephew also builds magento webshops and he costs candy instead of real dollar"

so fight through the struggles and you'll have a platform where your expert in for life, or at least until all developers move to a more developer friendly e-commerce platform.

In all seriousness tho, no clue. Magento shouldn't be this hard to pick up. and maybe the real question is if it's an option to still switch?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.