Magento - view product or controller file settings

In the file $MAGENTO_PATHapp/design/frontend/base/default/template/catalog/product/view/options/wrapper.phtml I see the following line of code:

 <?php echo $this->getChildHtml('', true, true);?> 

This is responsible for printing product parameters on the product page. I want to understand and change the html content that this line of code creates, but I cannot find a suitable view or controller for it. For example, suppose I want to programmatically add & nbsp; to innerHTML of each item in the drop-down list that I am editing a phtml, php or html file?

I hope that the answer to this question will help me understand how to get the product parameters, which, in turn, will help me solve this more immediate problem:

Magento - request for product parameters

+4
source share
1 answer

When passing an empty value to any of the getChild functions, all child elements are used. In this case, getChildHtml(''... returns the result of each of its toHtml outputs.

To find out that these are children, we need to look at the catalog.xml layout catalog.xml :

 <block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label"> <label>Info Column Options Wrapper</label> <block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/> <block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml"> <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action> <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action> <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action> <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action> </block> <block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/> </block> 

You can see from this messy mess that your wrapper unit has grandchildren "options" that have several renderers for different types of possible options. For the drop-down list, you probably need to edit catalog/product/view/options/type/select.phtml .

+7
source

Source: https://habr.com/ru/post/1340372/


All Articles