So it's been a day and a half on this. Really need some help!

I cannot get $this->getChildHtml() to pull in my template. I have tried heaps but will outline the main things. First, my code:


    This is the block you are looking for.


<?xml version="1.0" ?>

        <reference name="product.info">
            <block type="pvtl_shiptwo/shiptwoView" name="view.shiptwo" as="shiptwoProductView"


<div class="product-view">
<div class="product-essential">
    <?php echo $this->getBlockHtml('formkey') ?>
    <div class="no-display">
        <input type="hidden" name="product" value="<?php echo $_product->getId() ?>"/>
        <input type="hidden" name="related_product" id="related-products-field" value=""/>

    <div class="product-img-box">
        <div class="product-name">
            <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
        <?php echo $this->getChildHtml('media') ?>

    <div class="product-shop">
        <form action="<?php echo $this->getSubmitUrl($_product, array('_secure' => $this->_isSecure())) ?>" method="post" id="product_addtocart_form"<?php if ($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
            <div class="product-name">
                <span class="h1"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></span>

            <!-- Below should print template contents but doesn't -->
            <div class="shiptwo_product_view">
                <?php echo $this->getChildHtml('shiptwoProductView'); ?>

I know the block is being loaded as the name is printed when I use

<?php echo "<pre>", print_r($this->getSortedChildren(), 1), "</pre>"; ?>

I also tried the following:

<?php echo "<pre>", print_r($this->getChild('shiptwoProductView')->getTemplate(), 1), "</pre>"; ?>

This returns the correct template path. I have checked this path tens of times. It is correct.

To make sure the block was actually working I created a method inside Pvtl_Shiptwo_Block_ShiptwoView:

public function showText() {
    return 'Working!';

and called

<?php echo "<pre>", print_r($this->getChild('shiptwoProductView')->showText(), 1), "</pre>"; ?>

This returned the correct output.

I am completely stuck on this! Somebody please help!!

Edit By request, here is my config.xml

<?xml version="1.0" ?>






Screenshot of folder structure

2 Answers 2


make sure your custom block extends Mage_Core_Block_Template ?

Could show us your custom block file?

  • The block extends from Mage_Core_Block_Abstract. This is how I have worked it for all of my extensions previously. Should I be using _Template instead?
    – Wildcard27
    Commented May 13, 2016 at 0:29
  • You can use Mage_Core_Block_Template . Anyway Mage_Core_Block_Template extends Mage_Core_Block_Abstract
    – Sony
    Commented May 13, 2016 at 19:33

I think the main problem is presented in your block naming part.

You should name your block file with first letter capital and then all others small like this:

class Pvtl_Shiptwo_Block_Shiptwoview

Then in your layout file your code will be:

        <reference name="product.info">
            <block type="pvtl_shiptwo/shiptwoview" name="view.shiptwo" as="shiptwoProductView"
  • Thanks for the response but this made no difference. I think I'm going to go insane!
    – Wildcard27
    Commented May 12, 2016 at 23:17
  • How is your config.xml? Please add to the qst. Commented May 12, 2016 at 23:18
  • I have added this to the question
    – Wildcard27
    Commented May 12, 2016 at 23:25
  • Can you confirm your folder structure is like this: Pvtl->Shiptwo->Block->Shiptwoview.php and you have cleared your cache? Commented May 12, 2016 at 23:29
  • All that is correct. Will post screenshot
    – Wildcard27
    Commented May 12, 2016 at 23:35

Your Answer

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

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