0

I know how to override a native Magento 2 module templates such as "magento/module-customer", "magento/module-contact" etc....

But I curious to know, how to override a third party module placed in app/code/Sample_vendor1/Sample_module1 through my theme app/design/frontend/My_vendor/My_theme

Thank You.

2
  • It will be app/design/frontend/My_vendor/My_theme/Magento_Checkout/templates or app/design/frontend/My_vendor/My_theme/Magento_Checkout/layout
    – Jackson
    Commented Dec 19, 2016 at 6:59
  • Thanks Ankit, Yes I agree "Magento_Checkout" is a magneto native module and we can override like this app/design/frontend/My_vendor/My_theme/Magento_Checkout/temp‌​lates But how override a third party module "app/code/Sample_vendor1/Sample_module1" Commented Dec 19, 2016 at 7:04

3 Answers 3

4

It is done in the same way as you would override a core module's template.

vendor/My_vendor/My_theme/SampleVendor1_SampleModule1/templates

If your theme is in app/design, the path would be:

app/design/My_vendor/My_theme/SampleVendor1_SampleModule1/templates
2
  • how to override/extend other php file of a module? Commented Oct 2, 2017 at 13:17
  • What about adminhtml files in M2? For instance I am trying to extend Gene_Bluefoot and I have placed my files at app/design/adminhtml/My_Vendor/My_Theme/Gene_Bluefoot/templates but they are not working.
    – Metropolis
    Commented Nov 17, 2017 at 19:20
2

you can override module files in theme like below

app/design/frontend/My_vendor/My_theme/Sample_vendor1/templates
app/design/frontend/My_vendor/My_theme/Sample_vendor1/layout
app/design/frontend/My_vendor/My_theme/Sample_vendor1/web
2
  • Thanks FME, you mean app/design/frontend/My_vendor/My_theme/Sample_vendor1/Sample_module1/templates app/design/frontend/My_vendor/My_theme/Sample_vendor1/Sample_module1/layout app/design/frontend/My_vendor/My_theme/Sample_vendor1/Sample_module1/web module name "Sample_module1" missed Commented Dec 19, 2016 at 7:08
  • i mean app/code/namesapce/modulename in theme calling namesapce_modulename/templates Commented Dec 19, 2016 at 7:17
0

Follow the below-mentioned instructions for overriding a third party module

From :-

vendor/vendor_name/theme_name/vendor_module/templates

vendor/vendor_name/theme_name/vendor_module/layout

vendor/vendor_name/theme_name/vendor_module/web

To :-

app/design/frontend/vendor_name/theme_name/vendor_module/templates

app/design/frontend/vendor_name/theme_name/vendor_module/layout

app/design/frontend/vendor_name/theme_name/vendor_module/web

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.