I'm testing Magento on the localhost and I need to make some changes to the product page template.

I have been able to create a custom theme and modify it but I do not understand how to override the custom product page.

1 Answer 1


Depending on what you want to exactly achieve, you can extend any template file by looking at the Magento Catalog Module architecture. You can find it here /vendor/magento/module-catalog to know what is the module identifier, you need to look at the module 'registration.php' therefore, it is 'Magento_Catalog' that you are looking for.

That being said, you will need to extend each template file you want to customize into your own theme. So there is how you do it.

Create this architecture:


in which you will be able to extend layouts into


and templates into


Please, follow this link for a complete frontend guide on how layouts in Magento 2 works.


  • Ok, than you very much. I need to add an iframe to the product page, and i am not sure if it is better to costumize the theme layout or use a product attribute to do it
    – user48824
    Mar 3, 2017 at 16:55
  • Where do you need to add the iframe? Can you locate any block in which you would like to have it? Or you may wan't to create a block from scratch.
    – Dynomite
    Mar 3, 2017 at 20:49
  • I'd like to show the iframe at the beginning of the product page, or replace the gallery with it. It has to be dynamic and change for every product
    – user48824
    Mar 5, 2017 at 13:37

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.