0

I'm trying to update a website that's had about 5 different development agencies on it and it started as a theme. I've added a new module that adds a bunch of blocks to the product.info Reference. I've managed to clear out the remaining junk from other developers that has been placed in there with similar funcitonality.

The block is being called by $this->getChildHtml('product_type_data') along with some other required blocks. so I want to move the block to a new section of the page, It needs to go somewhere where there are no other blocks. It's been so long since I touched Magento that I can't remember how to do this, or the Magento term for creating a new childHtml section where I need it. I know i need to be unsettling the block From it's old location and setting it to the new one, but without a area to put it in I'm kind of stuck.

Module XML

...

<PRODUCT_TYPE_simple>
    <update handle="product.info.simple"/>
    <reference name="product.info">
        <block type="outofstocknotification/view" name="view" as="view"  />
    </reference>
</PRODUCT_TYPE_simple>

...

1 Answer 1

1

You can unset the block by using:

<action method="unsetChild">
    <alias>block.name</alias>
</action>

This will unset the child (as outlined by the method name) you could then add the block to the new reference:

<action method="append">
    <block>block.name</block>
</action>
4
  • How would that work in my example XML because I have tried that with about 30 different combinations of names and aliases that I can come up with and spent hours researching how to do this online with no luck. Jul 24, 2015 at 8:37
  • so where did you want to move the block product_type_data to? Is it inside the product.info?
    – rob3000
    Jul 24, 2015 at 8:58
  • Ideally to a new custom reference inside content, which is my issue as I can't find a up to date example of doing that. Jul 24, 2015 at 11:26
  • You might have to redefine the block yourself. So on your local.xml or theme.xml add the full block output. e.g ``` <reference name="custom"> <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml"/> </reference> ```
    – rob3000
    Jul 25, 2015 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.