I am trying to pull my attributes inside sidebar with the following code: 

```
$attributeValue = Mage::getModel('catalog/product')
        ->load($_product->getId())
        ->getAttributeText('weight_category');
echo $attributeValue;

```

But I get this error: 

```
Fatal error: Call to a member function getId() on a non-object in 

```

Any idea?

**UPDATE (from srdan)**

I work with Josip on that project. The problem is that everytime we want do something with $\_product object the error:

```
Fatal error: Call to a member function getId() on a non-object in /path/to/template/where/code/is.phtml

```

shows up. We use code below and error above shows up on frontend:

```
<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct();
?>

<?php if($_product->getSidebar()): ?>
<p>Attribute: <?php echo $_helper->productAttribute($_product, $_product->getSidebar(), 'price') ?></p>
<?php else: ?>
<p>No Attribute text here!</p>
<?php endif; ?> 

```