Magento – what is container1 and container2 in product view page in magento

layoutmagento-1.7productproducts-view

I need to know what is this container1 and container2 in magento product view page. i am talking about the file view.phtml in the location app/design/frontend/<package>/<theme>/catalog/product/view.phtml

upadate question:

I have asked this question because.. I came to know that, these sections are responsible for displaying the options in the product view page.

Actually my problem is I have 3 bundle product and I want to display their custom options in my own phtml file. I have these codes with me..

<?php
$id=Mage::getModel('catalog/product')->getIdBySku(123456);
$prod = Mage::getModel('catalog/product')->load($id);
$x=$prod->getOptions();
foreach($x as $y)
 {
echo $y->getTitle();
print_r($y->getValues());
}
?>

I need to get the product through it's sku.That is why I coded like this.now I am getting the title correctly. but there values not displaying.(note: I added two dropdown options as my custom options)

Thanks in advance.

Best Answer

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) ?>