I'm using the "product.info.extrahint" reference in my module layout to add my block and in the block template i'm calling a product attribute ('pticks') but for some reason its not working.

My module layout

<?xml version="1.0"?>
<layout version="0.1.0">
    <reference name="product.info.extrahint">
    <block type="core/template" as="productticks_productticks" template="productticks/productticks.phtml" />

Module template file

<?php $_helper = Mage::helper('catalog/output'); ?>
<div><?php echo $_product->getData('pticks');?></div>

The template is loaded but the attribute will not show. I'm getting the error Call to a member function getData() on null which i cant understand because this is on the product page and its clearly an object because the same code works fine on view.phtml.

Why will the attribute not load in my template file referenced in product.info.extrahint. What am i missing?

  • What happens if you replace getAttributeText('pticks') with getPticks() ? Commented Jun 5, 2016 at 13:07
  • Thanks tried that but no attribute value shown and getting error "Call to a member function getPticks() on null" Commented Jun 5, 2016 at 14:24

1 Answer 1


That means your $_product is not an object for some reason.

I suspect it's your layout.

Replace this

<block type="core/template" as="productticks_productticks" template="productticks/productticks.phtml" />


<block type="catalog/product_view" as="productticks_productticks" template="productticks/productticks.phtml" />

And you should have $_product = $this->getProduct() in your template.

Your productticks/productticks.phtml's block type is core/template which doesn't reference product object, that is why your $product is null.

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.