3

I want to list the options box move from view.phtml to default.phtml. Tried to copy and paste

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

into default.phtml. But this does not help to show the options on frontend :(

  • 4
    This is not a full answer, but 'getChildChildHtml' refers to the child nodes in layout xml files. So you'll need to replicate those nodes in your checkout.xml to get started, but I believe there are many more steps needed to actually make them functional. – Sam Jul 27 '13 at 19:59
2

What you need to do is set-up these child blocks against the correct block that you want them to show.

If by default.phtml you mean app/design/frontend/base/default/template/catalog/product/view/type/default.phtml then the blocks you are looking for are as follows:

  1. name="product.info.simple" - using the handle PRODUCT_TYPE_simple
  2. name="product.info.configurable" - using the handle PRODUCT_TYPE_configurable
  3. name="product.info.virtual" - using the handle PRODUCT_TYPE_virtual

First thing that you need to do is unset the current positioning of the container1 and container2 blocks.

<catalog_product_view>
    <reference name="product.info">
        <action method="unsetChild"><name>product.info.container1</name></action>
        <action method="unsetChild"><name>product.info.container2</name></action>
    </reference>
</catalog_product_view>

Now that we have done this we can consider moving these items and to do so we can simply insert these blocks in the correct handle.

<PRODUCT_TYPE_simple>
    <reference name="product.info.simple">
        <action method="insert"><child>product.info.container1</child></action>
        <action method="insert"><child>product.info.container2</child></action>
    </reference>
</PRODUCT_TYPE_simple>
<PRODUCT_TYPE_configurable>
    <reference name="product.info.configurable">
        <action method="insert"><child>product.info.container1</child></action>
        <action method="insert"><child>product.info.container2</child></action>
    </reference>
</PRODUCT_TYPE_configurable>
<PRODUCT_TYPE_virtual>
    <reference name="product.info.virtual">
        <action method="insert"><child>product.info.container1</child></action>
        <action method="insert"><child>product.info.container2</child></action>
    </reference>
</PRODUCT_TYPE_virtual>
| improve this answer | |

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.