Shopware 6 provides a flexible plugin and theme system for extending core features. In normal circumstances, you should never edit core files directly. Doing so makes future upgrades difficult and error‑prone. Instead, you should use plugins or apps. However if it is really not possible to make your necessary changes using these tools, you can also fix or adjust core behavior by applying patches via Composer.
Direct edits inside vendor/ are risky. When you update Shopware or dependencies, those changes will be overwritten, and since these changes are not written to git, it will never work correctly in a proper set up CI/CD project. Making direct changes in the vendor files complicates maintenance and increases the chance of bugs during upgrades. A maintainable alternative is to apply patches in a structured way using a Composer plugin.
Composer patches allow you to apply changes to third-party packages in a maintainable way. They are applied automatically during composer install or composer update, keeping your changes intact while still allowing updates from Shopware or other dependencies.
The recommended plugin for applying patches is cweagans/composer-patches. It integrates with Composer and ensures that your patches are applied consistently across all environments.
In Shopware 6, core files should never be modified directly. Instead, you can use Composer patches to apply fixes or adjustments to third-party packages in a safe and upgrade-proof way.
The recommended plugin for managing patches is cweagans/composer-patches. It integrates with Composer and ensures your patches are applied consistently across all environments.
In your composer.json, add an extra.patches section mapping the package to your patch
file:
{
"extra": {
"patches": {
"shopware/storefront": {
"Fix storefront template issue": "custom/patches/storefront-fix.patch"
}
}
}
}
Composer will apply the patch automatically whenever the package is installed or updated.
To create a patch:
vendor/ or create a branch from the relevant repository.Alternatively the Local History function in PHPStorm can also be used to generate your patch file.
Run composer install to apply patches automatically.
This workflow allows you to safely modify third-party packages while keeping your Shopware project upgrade-safe.