2

I am using magento 2.1 with the ultimo theme. I was customizing the login page which was not avaialable as a module in the theme.

So I go to vendor and changed the login page setting like text and placement of new register and old customer login place.

I want to ask is it okay to change these files . I know after the changes I have to compile so that these changes make it to the pub.

But in the vendor what should be done for the best practice.

P.S the path is /vendor/magento/module-customer/view/frontend/templates/newcustomer.phtml

Manoj Deswal
  • 5,785
  • 25
  • 27
  • 50
tech_geek
  • 321
  • 1
  • 7
  • 21

2 Answers2

5

To make changes in your customer module , copy file from vendor at path you changing right now

/vendor/magento/module-customer/view/frontend/templates/newcustomer.phtml

And place at following location in your theme, if folders are not present then you can create them. Copy only required file , no need to copy all the files

/app/design/frontend/Infortis/base/Magento_Customer/templates/newcustomer.phtml

Make your changes and run required commands to take effect.

In same way you can extend any module which is not present in your theme

Never make any changes in vendor files , always extend the module

Manoj Deswal
  • 5,785
  • 25
  • 27
  • 50
3

No this is not best practice. If you run any updates these changes will get overwritten. Any patches that are applied may fail if the files are different from originals as well.

You can, however, do this from within your theme. From your ultimo theme's root directory create new folders for that module Magento_Customer/templates.

Then copy the vendor file to your new folder:

Magento_Customer/templates/newcustomer.phtml

Then make modifications to your new file from there.

Mohit Kumar Arora
  • 9,951
  • 7
  • 27
  • 55
harri
  • 5,465
  • 6
  • 44
  • 100