Skip to content
Tutorials Center
My learning

Topics

Magento Tutorial

Learn Magento 2 and Adobe Commerce development: modules, dependency injection, plugins, observers, layouts, the database layer, APIs, performance and real projects. 42 lessons with examples, quizzes and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Magento Is and Where It Fits Learn what Magento 2 is, how Magento Open Source differs from Adobe Commerce, what you configure versus customise, and how these lessons teach with safe stand-ins.
  2. 2 Architecture and Directory Layout Tour the Magento 2 folders (app/code, vendor, pub, var, generated), follow a request from index.php to a response, and learn what the three deploy modes change.
  3. 3 Setting Up a Development Environment Set up a local Magento 2.4 environment: required services, Composer install with Marketplace keys, the setup:install command, file permissions and Docker options.

Modules

  1. 4 Your First Module Build your first Magento 2 module: folder naming, registration.php, etc/module.xml, enabling it with setup:upgrade and checking it with module:status.
  2. 5 Module Sequence and Dependencies Control Magento 2 module load order with the sequence node in module.xml, declare package dependencies in composer.json, and see how config is merged in order.
  3. 6 Areas and Configuration Files Understand Magento 2 areas (global, frontend, adminhtml, webapi_rest, graphql, crontab), how etc/ and etc/frontend/ files differ, and how XML is merged per area.

Dependency Injection

  1. 7 The Object Manager and Constructor Injection Learn how Magento 2 builds objects, why you should never call the ObjectManager directly, and how constructor injection and autowiring work, with a runnable stand-in.
  2. 8 Preferences and Interfaces in di.xml Learn how Magento 2 di.xml preferences map interfaces to classes, how to override core classes safely, how areas change them, and try a runnable stand-in.
  3. 9 Virtual Types and Constructor Arguments Learn Magento 2 virtual types, the di.xml argument types (object, string, array, const), and how to configure classes without subclassing, with runnable stand-ins.
  4. 10 Factories, Proxies and Generated Code Understand Magento 2 auto-generated Factory, Proxy and Interceptor classes, the generated directory and compile mode, with runnable PHP stand-ins for each idea.

Plugins and Events

  1. 11 Plugins (Interceptors) Learn Magento 2 plugins: before, around and after methods, di.xml declaration, sortOrder, what cannot be plugged, plus a runnable interceptor chain.
  2. 12 Plugin Best Practices and Pitfalls Avoid classic Magento 2 plugin mistakes: around plugins that skip others, unclear order, plugins versus preferences, performance cost and debugging, with demos.
  3. 13 Events and Observers Learn how Magento dispatches events, how to declare an observer in events.xml, how areas change which observers run, and when to use a plugin instead.

Requests and Output

  1. 14 Routing and Controllers Learn how Magento maps a URL to a controller action: routes.xml, frontName, the Controller folder layout, HTTP method interfaces and result factories.
  2. 15 Request, Response and Result Types Read request parameters safely and return the right Magento result: page, JSON, raw, redirect or forward. Includes runnable stand-ins for each result type.
  3. 16 Layout XML and Handles Understand Magento layout handles, containers versus blocks, referenceBlock, move, remove and update, and how layout files merge into one page structure.
  4. 17 Blocks, ViewModels and PHTML Templates Learn how Magento blocks, ViewModels and .phtml templates work together, how to pass arguments from layout XML, and how to escape output safely.
  5. 18 The Theme System and Frontend Assets Learn how Magento themes inherit from parents, how template and asset fallback works, what LESS and requirejs-config.js do, and how static content is deployed.
  6. 19 UI Components Overview Learn how Magento UI components build admin grids and forms from XML, how data providers feed them JSON, and where knockout and jQuery fit in.

Data and the Database

  1. 20 Declarative Schema (db_schema.xml) Describe your Magento tables in db_schema.xml and let setup:upgrade work out the SQL. Learn columns, constraints, indexes, the whitelist and schema diffing.
  2. 21 Data Patches and Schema Patches Learn how Magento data patches and schema patches run once per class, how dependencies and the patch_list table work, and how to write safe, revertable patches.
  3. 22 Models, Resource Models and Collections Understand Magento's three-class data pattern. A model holds data, a resource model talks to the table, a collection loads many rows lazily. Includes runnable stand-ins.
  4. 23 Collections, Filters and SearchCriteria Filter Magento collections with addFieldToFilter conditions, join tables, paginate, and build SearchCriteria with filter groups for AND and OR logic.
  5. 24 Service Contracts and Repositories Learn Magento service contracts, API and data interfaces, repositories, why modules should not call models directly, and extension attributes, with runnable stand-ins.
  6. 25 EAV: Entity-Attribute-Value Understand Magento's EAV model: attribute tables, value tables by type, catalog_product_entity, store scope, custom attributes via patches and the trade-offs.

Admin, APIs and Backend Services

  1. 26 System Configuration (system.xml) Add settings to Stores > Configuration with system.xml, set defaults in config.xml, read values with ScopeConfigInterface and understand scope fallback.
  2. 27 Admin Controllers, Menus and ACL Build a Magento admin page: adminhtml routes, controllers with ADMIN_RESOURCE, menu.xml entries, acl.xml permissions and secret keys, with runnable ACL stand-ins.
  3. 28 The REST API Learn Magento's REST API: webapi.xml routes mapped to service contracts, authentication with tokens and integrations, custom endpoints and searchCriteria queries.
  4. 29 GraphQL in Magento Extend Magento's GraphQL API: write schema.graphqls, connect fields to resolvers, add queries and mutations, handle errors and understand caching, with PHP stand-ins.
  5. 30 Cron Jobs and Message Queues Schedule Magento cron jobs with crontab.xml, read the cron_schedule table, and move slow work into message queues with publishers, topics and consumers.
  6. 31 Custom CLI Commands Write your own bin/magento commands in Magento 2.4: extend the Symfony Console Command, add arguments and options, register through di.xml, and practise with a runnable console stand-in.

Quality and Production

  1. 32 Indexers and Caching Understand Magento 2.4 indexers (Update on Save vs Update by Schedule, mview), cache types, cache tags and the full page cache, with runnable tagged-cache and changelog stand-ins.
  2. 33 Testing Magento Code A practical map of Magento 2.4 testing: PHPUnit unit tests, integration tests with fixtures, API-functional tests and MFTF, plus a runnable mini test runner with mocks.
  3. 34 Performance and Security Avoid N+1 queries and slow collection loads, cache wisely, profile before tuning, and secure Magento 2.4 code with escaping, form keys, ACL checks, bound queries and patching.
  4. 35 Deployment and Upgrades Plan Magento 2.4 deployments and upgrades: default, developer and production modes, di:compile, static content, config.php vs env.php, Composer upgrades and extension checks.

Projects

  1. 36 Project: A Complete Custom Module Assemble a full Magento 2.4 module end to end: declarative schema, repository, admin configuration, a frontend block and layout, with runnable plain-PHP stand-ins for each part.
  2. 37 Project: Extending Products with a Custom Attribute Add a custom product attribute in Magento with a data patch, show it with a plugin, layout XML and a ViewModel template, and rehearse every step in runnable PHP stand-ins.
  3. 38 Project: Order Events and Notifications Build an order notifier in Magento: an observer reacts to a placed order, publishes a queue message, a consumer sends it, and cron retries failures. With runnable stand-ins.
  4. 39 Project: A REST Integration Endpoint Build a custom Magento REST endpoint: a service contract, webapi.xml routes, ACL resources, validation and error handling, with a runnable dispatcher stand-in to test the ideas.

Practice and Review

  1. 40 Practice Exercises with Solutions Five hands-on Magento exercises on dependency injection, plugins, events, collections and layouts, each with a task, hints and a runnable plain-PHP stand-in solution.
  2. 41 Magento Interview Questions Prepare for a Magento developer interview: concise answers on architecture, dependency injection, plugins, events, EAV, indexers and caching, with two runnable stand-ins.
  3. 42 Magento Cheat Sheet A quick Magento 2.4.x reference: bin/magento commands, where files live, XML snippets for di, plugins, events, layout, cron and API, collection conditions and naming rules.