0

I have an extension installed via composer and wish to make some small changes so it fits better within my theme. The file is located at:

/vendor/<Namespace>/<Module>/view/frontend/templates/file.phtml.

I understand I can copy this file to my theme and override it without making xml updates. I just can't get the folder right where it should live.

I have tried following the official magento guide and other posts on here but it's not updating:

/<theme_dir>/<Namespace>_<Module>/templates/file.phtml

2 Answers 2

1

I think you misunderstood about Namespace_Module.

You need to get this value in the module’s registration.php file.

For example, an extension is located in <magento dir>/vendor/magetu/checkout-module. You need to get the value Namespace_Module in <magento dir>/vendor/magetu/checkout-module/registration.php

<?php

use \Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magetu_Checkout', __DIR__);

Your phtml override file should be located in <theme_dir>/Magetu_Checkout/templates/file.phtml

2
  • 1
    You are correct Tu. using the correct details from the registration file kicked it into action straight away. Thank you very much for your help
    – AndyS
    Apr 17 at 8:23
  • You’re welcome @AndyS
    – Tu Van
    Apr 17 at 8:38
1

The full path should be: app/design/frontend/<Vendor>/<theme>/<Namespace>_<Module>/templates/file.phtml

HTH, Tom

1
  • Thanks for taking the time to reply Tom, this is actually where I put the files, just me shortening the theme folder name
    – AndyS
    Apr 17 at 8:20

Your Answer

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

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