0

I already have a working accordion static block on my product page i want to use to display the description.

Currently the description is being shown in tabs above the image which is soon to be disabled/hidden. I need to use a SQL/PHP call to get the product description in plain text and I will use a Div to style it.

Currently I am using this in my static block:

{{block type="core/template" name="description" template="custom/description.phtml"}}

And that loads this file - which i pulled from my app/design/frontend/default/milano/catalog/product/view/description.phtml:

<div id="custom_description">
<?php 
$_description = $this->getProduct()->getDescription();
$_name = $this->getProduct()->getName();
?>
<?php if ($_description): ?>
    <!-- <h2><?php echo $this->__('Details') ?></h2> -->
    <div class="std">
        <?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_description, 'description') ?>
    </div>
<?php endif; ?>
</div>

When I use this, it stops anything loading from that block down. I assume i'm calling too much or too little.

Any help is appreciated! CHEERS!

4

If you are in product page then you can get product object of your current product object. by registry variable

   $productObject=Mage::registry('current_product');
$_description = $productObject->getDescription();

current_product registry will give all the value of current product For check this goto

initProduct function of class Mage_Catalog_Helper_Product

 $product = Mage::getModel('catalog/product')
            ->setStoreId(Mage::app()->getStore()->getId())
            ->load($productId);
......

 Mage::register('current_product', $product);
-1
$productObject=Mage::registry('current_product');
$_description = $productObject->getDescription();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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