2
votes

I've installed an extension which generates an auto related product block. Unfortunately for some reason this wants to create its own block rather than replace the native one (the extension seems somewhat broken in this sense?)

Anyway, after contacting their support - I'm getting no responses and now I'm stuck having to fix this myself.

First step for me would be to include this block in our catalog/product/view.phtml file. Having inspected the extension code (layout file) I can see the following:

<block type="autorelatedproduct/autorelatedproduct" name="autorelatedproduct" template="autorelatedproduct/autorelatedproduct.phtml" />

Having included this in my catalog.xml file under the content in product view and then trying to call this block through the template. I am getting nothing new.

Would anyone be able to help me out and tell me how I could include this block in my template?

As always, any help is always appreciated!

2
On which Magento version are you working?Suman Singh

2 Answers

1
votes

You could call this in your local.xml like

 <?xml version="1.0"?>
    <layout version="0.1.0">
       <catalog_product_view>
        <reference name="content"> 
            <block type="autorelatedproduct/autorelatedproduct" name="autorelatedproduct" template="autorelatedproduct/autorelatedproduct.phtml" />    
        </reference>
      </catalog_product_view>
   </layout>

If you want to place it specific position you can try

 <reference name="product.info">

and call it in view.phtml like getChildHtml('yourblock');

0
votes
<catalog_product_view translate="label">
    <reference name="content">
        <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
            <block type="autorelatedproduct/autorelatedproduct" name="autorelatedproduct" template="autorelatedproduct/autorelatedproduct.phtml" />
        </block>
      </catalog_product_view>

and call this using echo $this->getChildHtml('autorelatedproduct'); in view.phtml