1

We use the PayPal integration made available through the built-in Braintree support. I want to override the following template so I can change the button URL.

\vendor\magento\module-braintree\view\frontend\templates\paypal\button.phtml

I have created the following file to override this:

\app\design\frontend\Company\Theme\Magento_Braintree\view\frontend\templates\paypal\button.phtml

This has no effect though, and the old file is used. This is also demonstrated with the template hints switched on:

enter image description here

The first button has also been overridden, and this works as expected.

I have cleared cache, deployed static content etc.

Have I missed something? Do you have to have more than just a view to an override work?

tim.baker
  • 843
  • 1
  • 12
  • 29

1 Answers1

2

In your custom theme, we don't need view\frontend.

It should be like this:

app\design\frontend\Company\Theme\Magento_Braintree\templates\paypal\button.phtml
Khoa TruongDinh
  • 32,054
  • 11
  • 88
  • 155
  • Yup.... just like all my other overrides! Thanks for that, I think I might stop working for today :/ – tim.baker Jun 10 '17 at 16:16
  • Yup... we should relax today. – Khoa TruongDinh Jun 10 '17 at 16:18
  • Indeed, though that is not going to happen. Before I ask it in another question, similar to this one, do you know why overwriting "\vendor\magento\module-checkout\view\frontend\web\template\cart\totals\grand-total.html" with "\app\design\frontend\Thespicery\standard\Magento_Checkout\web\template\cart\totals\grand-total.html" doesn't work? Thought I'd ask just in case. One-page check out confusing and the official docs are lacking :/ http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_customize.html – tim.baker Jun 10 '17 at 17:37
  • Your code should work: https://magento.stackexchange.com/questions/96540/magento-2-how-to-override-mini-cart-default-template-html-file/121713#121713. – Khoa TruongDinh Jun 11 '17 at 00:29
  • Thanks again, it did work. Discovered after a long time a bug in GitHub that the cache and static content didn't work as expected ☹️ – tim.baker Jun 11 '17 at 08:21