I am trying to override a core phtml file following the advice in this question How to override .phtml files in Magento 2. I am not able to get it to work and I am wondering in general how the path of the override file is determined so I can know if I am putting it in the correct location. For example, I am overriding the file
vendor/magento/module-catalog/view/base/templates/product/price/amount/default.phtml
and I am not quite sure if the right path would be
app/design/frontend/MyCompany/MyTheme/Magento_Catalog/view/base/templates/product/price/amount/default.phtml
or
app/design/frontend/MyCompany/MyTheme/Magento_Catalog/templates/product/default.phtml.
My intuition goes with the second choice since the directories templates and product are already present while the view and everything after in the first choice are not. I have not been able to get either to work and I am wondering which one is correct or if it is supposed to be a third location.