2

In Magento 2 you can install themes and extensions through composer and they end up in the vendor folder.

What if I want to make customisation to that template/extension?

Do I copy the code over to app/code or app/design or do I create a complete composer package for the custom extension/template based on the original one and push this to a private repo?

But what if we do it on the composer way, how would we go about when the original extension/module receives updates that we install through composer? Any way of maintaining your own extension/template then?

0

create a complete composer package for the custom extension/template based on the original one and push this to a private repo?

Forking the repository like this is possible, but then you become the maintainer and need to merge changes from upstream to receive updates.

The preferred approach is to make customizations without changing the original code, using the same mechanism that extensions and themes use to customize the core:

  1. Theme inheritance for themes: http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-inherit.html
  2. Dependency injection (http://devdocs.magento.com/guides/v2.1/extension-dev-guide/depend-inj.html) and plugins (http://devdocs.magento.com/guides/v2.1/extension-dev-guide/plugins.html) for extensions

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.