1

I am trying to add a new container for configurable options in my layout and call the child theme from a custom view.

Here is the part of the code from my view.phtml :

 <?php if ($_product->isSaleable() && $this->hasOptions()):?>
 <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
 <?php endif;?>

Nothing special as it is a default part of magento.

Now looking at the layout we see the following default as well :

<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 a bit lower for the configurable product :

<PRODUCT_TYPE_configurable translate="label" module="catalog">
<label>Catalog Product View (Configurable)</label>
<reference name="product.info">
    <block type="catalog/product_view_type_configurable" name="product.info.configurable" as="product_type_data" template="catalog/product/view/type/default.phtml">
        <block type="core/text_list" name="product.info.configurable.extra" as="product_type_data_extra" translate="label">
            <label>Product Extra Info</label>
        </block>
    </block>
    <block type="catalog/product_view_type_configurable" name="product.info.availability" as="product_type_availability" template="catalog/product/view/type/availability/default.phtml" />
</reference>
<reference name="product.info.options.wrapper">
    <block type="catalog/product_view_type_configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="catalog/product/view/type/options/configurable.phtml">
        <block type="core/text_list" name="product.info.options.configurable.renderers" as="attr_renderers" />
        <block type="core/text_list" name="product.info.options.configurable.after" as="after" />
    </block>
</reference>

So, what I am trying to do is to create another container product.info.options.wrapper with a different template. So that I could call from my view page $this->getChildChildHtml('container3', '', true, true) or $this->getChildChildHtml('container1', '', true, true) when needed.

Can somebody tell me how to do that?

Thanks a lot (I think my approach is wrong, what I want is to have different option template for different view template)

Your Answer

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

Browse other questions tagged or ask your own question.