-3

Where is the code to edit the information displayed on my magento store?

For example where can I see where the description of a product with custom attributes is shown and add a button to call custom functions.

I don't know which .php files to change for modifying the product information, add to cart, and more.

  • 3
    This is a really broad question. You're essentially asking about the MVC conventions of the Magento framework. Normally a question this broad would be closed, but I believe the answer given is valuable not only to you but also to others who may find it, so I'm going to leave it open. – benmarks Feb 18 '15 at 16:27
25

The most relevant parts for you in this case are:

  • Template file (.phtml) and
  • Blocks

While the template files include the basic HTML output, which is a combination of PHP and HTML (thus .phtml), the blocks are interacting with the Magento system to retrieve data from models.

Example: The file which creates the HTML output for the product pages is app/design/frontend/rwd/default/template/catalog/product/view.phtml which belongs to the Block Mage_Catalog_Block_Product_View (can be found in app/code/core/Mage/Catalog/Block/Product/View.php).

The .phtml files will mostly call functions from the Block, such as in view.phtml:

<?php $_product = $this->getProduct(); ?> refers to the function getProduct() of Mage_Catalog_Block_Product_View.

Whatever you do: Do not edit these core files. Familiarize yourself with best practise methods of how to work with Magento.

A good starting point for this is Alan Storms Blog: http://alanstorm.com/category/magento#magento_for_php_developers

23

These are all located in your theme directory.

If looks like you are talking specifically about the product details page, so the main one to change would be located in your themes catalog/product/view.phtml.

Since you do seem to be brand new to Magento, I would recommend you get to understand the basic design concepts of Magento. This guide should help you get started: http://info.magento.com/rs/magentocommerce/images/MagentoDesignGuide.pdf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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