Contents
Magento / Adobe Commerce
A platform for large online shops: modules, dependency injection, plugins, layouts and the API.
1.Getting started
- Introduction to MagentoWhat Magento Open Source and Adobe Commerce are, which shops they suit, what you need to work with them and what the course builds.
- InstallationHow to create a Magento project with Composer, run the setup:install installer, open the storefront and the admin panel and add sample products.
- Project structureA tour of the Magento project folders: where your modules and themes live, where the core is, installation settings, generated classes, cache and logs.
- Core conceptsA Magento beginner's vocabulary: website, store and store view, the frontend and adminhtml areas, modules, themes and application modes.
- The bin/magento tool and developer modeThe Magento console tool: how to run bin/magento, which commands you need every day and how to switch to developer mode.
- The first moduleHow to create a Magento module by hand: a folder in app/code, the registration.php and module.xml files, enabling the module and checking its status.
2.Storefront pages
- RoutesHow Magento connects a page URL with a module: the routes.xml file, frontName, the three parts of a URL and links to your own pages.
- Controllers and actionsAn action class in Magento: where it lives, the execute method, result types — text, page, JSON and redirect — and reading request parameters.
- LayoutsLayout XML files in Magento: how the file name relates to the URL, what containers and blocks are, how to add, remove and move a block on your own and on a core page.
- Templatesphtml templates in Magento: where they live, the $block and $escaper variables, passing values from a layout, escaping output and links.
- View models and blocksHow to prepare data for a Magento template: a ViewModel class, attaching it in a layout and using it in a template, plus a custom block class.
- Themes, styles and scriptsDesign basics in Magento: how to create your own theme, override a template in it, attach CSS from a module and add a script through RequireJS.
3.Dependencies and extension
- Dependency injectionDependency injection in Magento: dependencies in the constructor, how Magento picks objects, the di.xml file and preferences for interfaces.
- Arguments, virtual types and factoriesConfiguring objects in di.xml: constructor arguments, arrays, virtual types, factories for creating new objects and proxies for heavy dependencies.
- PluginsMagento plugins: how to change the result or the arguments of a core method without editing the core, the before, after and around kinds and registration in di.xml.
- Events and observersEvents in Magento: the events.xml file, an observer class, event data, common core events and dispatching your own event.
4.Data
- Declarative schemaHow a Magento module creates its tables: the db_schema.xml file, columns, keys and indexes, the setup:upgrade command and the db_schema_whitelist.json whitelist.
- Models, resource models and collectionsWorking with a table from Magento code: a model, a resource model and a collection, creating and reading records, filters and printing reviews on a page.
- Data interfacesMagento service contracts: why a module has an Api folder, how to describe a data interface for a review, implement it in the model and bind it through di.xml.
- RepositoriesA repository in Magento: an interface with the save, getById, getList and deleteById methods, its implementation and searching records with SearchCriteria.
- Data and schema patchesPatches in Magento: how to add initial records with a DataPatchInterface class, when a schema patch is needed, how to set the order and why a patch runs once.
- Products, categories, customers and ordersHow to read and change Magento core data from your module: the product, category, customer and order repositories and searching with SearchCriteria.
- EAV and product attributesHow Magento stores product properties using the EAV model and how to add your own product attribute with a data patch, then read and change its value.
5.Configuration and admin
- Module configurationMagento module settings: fields in system.xml, default values in config.xml, reading with ScopeConfigInterface and the website and store view scopes.
- An admin pageYour own page in the Magento admin panel: permissions in acl.xml, an adminhtml route, a menu item in menu.xml, an action with ADMIN_RESOURCE and the page layout.
- An admin grid: UI componentsA short introduction to Magento UI components: a reviews grid in the admin panel through a listing XML file and a data source in di.xml, and what a form requires.
6.API and background jobs
- REST APIHow to expose Magento module data through REST: the webapi.xml file, binding a URL to a repository method, access permissions and requests with a token.
- GraphQLGraphQL in Magento: the schema.graphqls file, your own query and type, a resolver class that returns reviews, and testing a query with curl.
- Console commandsHow to add your own command to bin/magento: a command class, registration in di.xml, arguments and options, printing messages.
- Cron jobsCron in Magento: the crontab.xml file, a job class, running the scheduler with cron:install and cron:run, and a short mention of message queues.
7.Running in production
- Cache and indexersHow Magento speeds things up: cache types and the cache:clean and cache:flush commands, the full page cache, catalog indexers and their update modes.
- TranslationsTranslating a Magento module: the __() function, i18n files in CSV format, placeholders, translating strings in XML and collecting phrases with a command.
- Logging and debuggingHow to find errors in Magento: writing to the log through LoggerInterface, files in var/log and var/report, template hints, the database query log.
- DeploymentDeploying Magento to a production server: production mode, the order of build commands, compilation, static content, maintenance mode and a pre-launch checklist.