Shopware Plugin Development Tutorial
Learn Shopware Plugin Development step by step: 30 lessons in 10 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is Shopware 6? Learn what Shopware 6 is, how its Symfony, Twig and Vue stack fits together, and when to build a plugin, an app or a theme for your own shop.
- Setting Up a Development Environment Set up a local Shopware 6 shop for plugin development: Docker or a native stack, composer create-project, system:install, debug mode and watch scripts.
- Your First Plugin Build a minimal Shopware 6 plugin: composer.json, the Plugin base class, plugin:refresh, plugin:install --activate and a subscriber that says hello.
Architecture
- Services and the Dependency Injection Container Learn how Shopware plugins define services in services.xml, use tags, and decorate core services with the Symfony container, with a runnable mini container.
- Plugin Structure and Lifecycle Understand the Shopware 6 plugin folder layout and the install, update, activate, deactivate and uninstall hooks, including keepUserData and update migrations.
- Plugin Configuration Add settings to a Shopware 6 plugin with config.xml, read them with SystemConfigService per sales channel, use them in Twig and validate the values.
Data Abstraction Layer
- Custom Entities and Definitions Learn how the Shopware Data Abstraction Layer describes data with EntityDefinition, field flags, Entity and EntityCollection classes, and the services.xml tag.
- Database Migrations Create tables for your plugin with Shopware migrations: MigrationStep, timestamps, update versus destructive phases, running commands and safe rollbacks.
- Reading and Writing with Repositories Read and write data in Shopware with the DAL: Criteria filters, sorting, limits, associations, aggregations, search vs searchIds, upsert, delete and Context.
- Entity Extensions and Custom Fields Add data to Shopware core entities safely: EntityExtension with new fields and associations, custom field sets, translated fields and how to choose.
Events, Flows and Background Work
- Subscribers and Core Events React to Shopware with event subscribers: EventSubscriberInterface, entity written and loaded events, page loaded events, priorities and how to avoid slow side effects.
- Flow Builder: Triggers and Custom Actions Understand Shopware Flow Builder triggers, conditions and actions, and write a custom FlowAction with aware interfaces, registration and an admin form.
- Scheduled Tasks and the Message Queue Run recurring and background work in Shopware 6: ScheduledTask classes, handlers, Messenger messages, workers, retries and idempotent jobs, with PHP stand-ins.
APIs
- Custom Store API Routes Build a custom Shopware 6 Store API route with the abstract route pattern, getDecorated(), sales channel context, responses and cache invalidation.
- The Admin API and Integrations Call the Shopware 6 Admin API from other systems: integrations with client credentials, search criteria in JSON, the bulk sync API and batching advice.
- Apps, Webhooks and Signatures Understand the Shopware app system: manifest.xml, the registration handshake, webhook events, HMAC signature checks, retries and idempotent handlers.
Storefront
- Storefront Templates with Twig Customize the Shopware 6 storefront with Twig: sw_extends, block overrides with parent(), sw_include and page-loaded subscribers that add your data to a page.
- Styling and JavaScript in the Storefront Style and script the Shopware 6 storefront: theme.json, SCSS variable overrides, JavaScript plugins bound to data attributes, build commands and accessibility.
Administration
- The Administration at a Glance Understand the Shopware 6 Administration: a Vue single-page app with modules, components, Twig templates, snippets and ACL, plus a runnable override registry stand-in.
- Building an Admin Module Build a Shopware 6 admin module: register routes and navigation, write list and detail pages, save through the repository and handle privileges, with a runnable state model.
Quality and Production
- Testing Plugins Test Shopware 6 plugins with PHPUnit unit and integration tests, test traits, database transactions, mocks and Jest for the admin, plus runnable test helpers.
- Security and Performance Make Shopware plugins safe and fast: ACL, input validation, avoiding N+1 reads and unbounded associations, cache invalidation, indexers and queue limits, with runnable demos.
- Packaging, Deployment and Updates Ship a Shopware plugin: composer.json metadata, zip builds, shopware-cli, deployment steps, update migrations and version compatibility, with a runnable constraint checker.
Projects
- Project: Product Badges Build a Shopware 6 plugin that shows product badges: a custom field, a page subscriber, a Twig block, SCSS and color configuration, with runnable data-flow stand-ins.
- Project: A Custom Wishlist API Build a wishlist for logged-in customers: a custom entity, a migration, a Store API route with validation and a JSON response, plus tests and runnable stand-ins.
- Project: Order Export Task Build a scheduled task that pages through orders with the DAL, writes a safe CSV file, reads its target from plugin config and can be re-run without duplicates.
- Project: Syncing Stock from an ERP Keep Shopware stock in step with an ERP: pull or push, map and validate rows, upsert in batches, retry safely, ignore stale updates and log every rejected row.
Practice and Review
- Practice Exercises with Solutions Twelve graded Shopware plugin exercises with hints and solutions: container, decoration, tags, criteria, migrations, N+1, events, routes, config, Twig blocks and HMAC.
- Shopware Interview Questions Prepare for a Shopware 6 developer interview: concise answers on architecture, the DAL, events, plugins versus apps, caching, security and deployment, with two runnable stand-ins.
- Shopware Plugin Cheat Sheet A quick Shopware 6 plugin reference: bin/console commands, plugin directory layout, service tags, Criteria snippets, event names and the pitfalls that cost the most time.