what is container1 and container2 in product view page in magento
These relate to the position in which the product's custom options are displayed.
See app/code/core/Mage/Catalog/etc/config.xml
:
<design>
<options_container>
<option1 translate="label">
<value>container1</value>
<label>Product Info Column</label>
</option1>
<option2 translate="label">
<value>container2</value>
<label>Block after Info Column</label>
</option2>
</options_container>
</design>
Here you can see that container1
relates to 'Product Info Column', while container2 is 'Block after Info Column'. These values are describing where the custom options will be displayed on the product view page. You can set these values when editing a product in the Magento admin under the Design tab.
The layout blocks are defined in app/design/frontend/base/default/layout/catalog.xml
:
<block type="core/template_facade" name="product.info.container1" as="container1">
<action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
<action method="append"><block>product.info.options.wrapper</block></action>
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>
<block type="core/template_facade" name="product.info.container2" as="container2">
<action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
<action method="append"><block>product.info.options.wrapper</block></action>
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>
And in app/design/frontend/base/default/template/catalog/product/view.phtml
you will see two calls:
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
and
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>