Magento works with .phtml template files to generate the view layer for the users. The modules and themes in Magento have its specific group of .phtml files to show data to the users. Let's create a custom template example in the CompStore theme to see how it works:
Magento_Catalog directory under the compstore theme directory.vendor/magento/module_catalog/view/frontend/templates to app/design/frontend/Packt/compstore/Magento_Catalog/templates.app/design/frontend/Packt/compstore/Magento_Catalog/templates/product/view/addto.phtml file in your favorite code editor.<div><h2>Buy in CompStore!!!</h2></div>
var/view_preprocessed/ and pub/static/frontend/Packt/compstore/ directories.php magento setup:static-content:deploy command.write permission to the pub directory.Navigate to the product page to see the result, as in the following screenshot:
