1

I'm attempting to move my product's SHORT description into my long description, without merging the two during import. I attempted to move the following code into my description.phtml file, but it just breaks the page at the description area.

<?php if ($_product->getShortDescription()):?>
    <div class="short-description">
        <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
    </div>
<?php endif;?>

Any idea how to effectively move the short description to just above the main description area? Do I need to do anything with the XML code?

1

Put below code at very top of the file app\design\frontend\[package]\[theme]\template\catalog\product\view\description.phtml.

<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct();
?>
<?php if ($_product->getShortDescription()):?>
    <div class="short-description">
        <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
    </div>
<?php endif;?>

<br />

You are done. For full reference of the modified file, you can refer this.

1

Add your code inside the description if statement in the product/view.phtml file

<?php if ($_product->getDescription()):?>
    //my short description code
<?php endif;?>
  • sorry done via mobile but anyway just look at the view.phtml file and find where the long description is output – BENN1TH Oct 13 '15 at 0:42
  • But the long description is output in the description.phtml file. If I attempt to add the short description there, it breaks the page. – Ken Oct 13 '15 at 0:56

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.