cancel
Showing results for 
Search instead for 
Did you mean: 

How to change a phtml file in the vendor/ folder?

How to change a phtml file in the vendor/ folder?

Hi 

I am trying to make changes to a phtml in 

vendor/magento/module-newsletter/view/frontend/templates. I have made a new directory and placed the new phtml file to the app/design/frontend/Swissup/argento-pure2/Magento_Newsletter/templates. Does this sound correct? I'm unsure of my Theme Vendor and my Theme Name, I guessed them to be Swissup and argento-pure2. When I check using template-hints, it still doesn't use the modified version. What am I missing? 

Thank you

6 REPLIES 6

Re: How to change a phtml file in the vendor/ folder?

@kanchi777k3aa3 

You can find correct theme name from pub like(/pub/static/frontend/Mgs/child_claue => In my case Mgs /child_claue is theme name). Just copy that name and paste in app/design/frontend
now it is /app/design/frontend/Mgs/child_claue.
 
Check your store has applied that theme properly or not.
 
Then add the Magento_Newsletter folder and add templates to it.
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: How to change a phtml file in the vendor/ folder?

If your current store theme is

Swissup/argento-pure2

then this is your correct path of files :

app/design/frontend/Swissup/argento-pure2/Magento_Newsletter/templates


After doing above things run this commands from CLI and then check.

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
sudo chmod -R 777 var/ generated/ pub/


 

Was my answer helpful? You can Click Kudos/Accept As Solution.
200+ professional extensions for M1 & M2 with free lifetime updates!

Re: How to change a phtml file in the vendor/ folder?

@Sanjay Jethva @Dhiren Vasoya 

It still doesn't work

 

I check the folder pub/static/frontend and the admin page. 

 

admin: content/design/themes (here a few themes are listed)

Capture1.PNG

 

admin: content/design/configuration

Capture2.PNG

pub/static/frontend

Capture3.PNG

Re: How to change a phtml file in the vendor/ folder?

You need to confirm those things by doing this one :

1. You are checking proper theme which is loaded on the store frontend.

2. Same file is not override by other extension.

3. Enable the template path hints for your store and check which template current call on that place as of now. so you get idea.

Was my answer helpful? You can Click Kudos/Accept As Solution.
200+ professional extensions for M1 & M2 with free lifetime updates!

Re: How to change a phtml file in the vendor/ folder?

Hi @Dhiren Vasoya 

1. Yes, here are a few that are loaded to the frontend:


<link rel="stylesheet" type="text/css" media="all" href="https://.../pub/static/version1639165346/frontend/Swissup/argento-pure2/en_US/Swissup_SlickCarousel/css/slick-magento.css" />


<link rel="stylesheet" type="text/css" media="all" href="https://.../pub/static/version1639165346/frontend/Swissup/argento-pure2/en_US/Swissup_Testimonials/css/testimonials.css" />

 

2. As far as I know, no. Is there a surefire way of knowing for sure? 

 

3. Already checked with template hint paths

 

Re: How to change a phtml file in the vendor/ folder?


@kanchi777k3aa3 wrote:

Hi 

I am trying to make changes to a phtml in 

vendor/magento/module-newsletter/view/frontend/templates. I have made a new directory and placed the new phtml file to the app/design/frontend/Swissup/argento-pure2/Magento_Newsletter/templates. Does this sound correct? I'm unsure of my Theme Vendor and my Theme Name, I guessed advancedmd them to be Swissup and argento-pure2. When I check using template-hints, it still doesn't use the modified version. What am I missing? 

Thank you


Follow the steps I hope it might be helpful to you :

 

You are checking proper theme which is loaded on the store frontend.

Same file is not override by other extension.

Enable the template path hints for your store and check which template current call on that place as of now. so you get idea.