I want to add some static data in magento 2 product page in details.phtml

So please tell me how can i override this file without create any new module :



2 Answers 2


You have to just override in your theme.

  • but i don't have any theme i have to just change in above details.phtml file
    – user46386
    Commented Nov 3, 2016 at 6:03
  • you have to create theme or you have to directly add content inside your module template file Commented Nov 3, 2016 at 6:04
  • Using directly override template file is not good practice in magento, You need to override template file using create theme in your magento Commented Nov 3, 2016 at 6:04
  • please let me know if you have any issue Commented Nov 3, 2016 at 6:10
  • I created /opt/lampp/htdocs/magento2/app/design/frontend/Vendor/theme/view/frontend/templates/product/view/details.phtml but don't get any changes in front product page
    – user46386
    Commented Nov 3, 2016 at 6:13

add sequence in your module.xml as which module phtml you want ot override like :

        <module name="Magento_Catalog"/>

then add file directly with same path as vendor module has and override code.

(if it has in layout you need to override it first then call this default.phtml file through layout xml)

Your Answer

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