Modify PHP to show the HTML instead of the code

I am working with Magento and have figured out how to get a particular variable to show on the grouped product display page, but am not sure since my PHP skills are slim to none on how to get it not show the code and recognize the code that is there so that it will display correctly.  Currently it displays on the code.  I'm pretty sure it's the htmlEscape, but I don't know what else to use.  Below is the code and the line I am referring to is the getShortDescription:

<td><?php echo $this->htmlEscape($_item->getName()) ?></td>
                  <td><?php echo $this->htmlEscape($_item->getShortDescription()) ?></td>
            <td class="a-right">
                <?php echo $this->getPriceHtml($_item, true) ?>
                <?php echo $this->getTierPriceHtml($_item) ?>
            </td>
            <?php if ($_product->isSaleable()): ?>
            <td class="a-center">
            <?php if ($_item->isSaleable()) : ?>

Thanks in advance!
kmurphychiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ArmandProgrammer / DeveloperCommented:
Hi,

One way to do is to call javascript window.open function and passing it the all the well-formed html code inside it. This example pops-up a window on page exit/unload:

<html>
<head>
 <title>JavaScript Popup Example 3</title>
</head>
<SCRIPT language="JavaScript1.2">
function exitpop()
{
my_window= window.open ("",
  "mywindow1","status=1,width=350,height=150");
my_window.document.write('<H1>Popup Test!</H1>');
}
</SCRIPT>
<body onunload="javascript: exitpop()" >
<H1>JavaScript Popup Example 4</H1>
</body>
</html>
kmurphychiAuthor Commented:
Unfortunately this is not a viable option.  I am trying to not have to hack too much of the core code of Magento, so that would be the safest bet for me to have the html code displayed instead of it stripping it, but thanks for the tip!
ahdfxCommented:
What is the name of the file that is being loaded?
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

kmurphychiAuthor Commented:
Do you mean the magento file?  If so it is group.phtml
Marco GasiFreelancerCommented:
Try to use html_entity_decode() instead of htmlEscape.

Cheers
ahdfxCommented:
If I am understanding correctly.  You are trying to get group.phtml to process PH code?  Is that correct?
if so, you need to modify the htaccess file to process phtml as php.  If that is not what you are trying to accomplish...  Then I don't know what you are trying to do.
V4nP3rs13Commented:
<?php
$file = "include.php"; //put your file path here
echo str_ireplace(array("<", ">"), array("&lt;", "&gt;"), file_get_contents($file));
?>
kmurphychiAuthor Commented:
I think the html_entity_decode()should work, but do I write it as <td><?php echo $this->html_entity_decode()($_item->getShortDescription()) ?></td>  ?  If so it's not working.
Ray PaseurCommented:
Where is the test URL that shows the error in action?  I'll take a look.  Thanks, ~Ray
kmurphychiAuthor Commented:
http://mrrhythmschildrensmusic.com/magento/index.php/childrens-music-1/mr-rhythm-s-zoo.html
Here it is with the <td><?php echo $this->html_entity_decode()($_item->getShortDescription()) ?></td> for which I get a parse error syntax.  If the line is <td><?php echo $this->htmlEscape($_item->getShortDescription()) ?></td> it spits out the code instead of the HTML as it should be.

If you need the entire code for the page, it is here:  Thanks so much for all of your help!
<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/**
 * Grouped product data template
 *
 * @see Mage_Catalog_Block_Product_View_Media
 * @see Mage_Catalog_Block_Product_View_Type_Grouped
 */
?>
<?php $_product = $this->getProduct() ?>
<?php $_associatedProducts = $this->getAssociatedProducts() ?>
<?php if($_product->isSaleable() && count($_associatedProducts)): ?>
    <p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
<?php else: ?>
    <p class="availability out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>
<?php echo $this->getChildHtml('product_type_data_extra') ?>
<table class="data-table grouped-items-table" id="super-product-table">
    <col />
    <col />
    <col width="1" />
    <thead>
        <tr>
            <th><?php echo $this->__('Product Name') ?></th>
                  <th><?php echo $this->__('Sample The Music') ?></th>
            <th class="a-right"><?php echo $this->__('Price') ?></th>
            <?php if ($_product->isSaleable()): ?>
            <th class="a-center"><?php echo $this->__('Qty') ?></th>
            <?php endif; ?>
        </tr>
    </thead>
    <tbody>
    <?php if (count($_associatedProducts)): ?>
    <?php foreach ($_associatedProducts as $_item): ?>
        <?php $_finalPriceInclTax = $this->helper('tax')->getPrice($_item, $_item->getFinalPrice(), true) ?>
        <tr>
            <td><?php echo $this->htmlEscape($_item->getName()) ?></td>
                  <td><?php echo $this->html_entity_decode()($_item->getShortDescription()) ?></td>
            <td class="a-right">
                <?php echo $this->getPriceHtml($_item, true) ?>
                <?php echo $this->getTierPriceHtml($_item) ?>
            </td>
            <?php if ($_product->isSaleable()): ?>
            <td class="a-center">
            <?php if ($_item->isSaleable()) : ?>
                <input type="text" name="super_group[<?php echo $_item->getId() ?>]" maxlength="12" value="<?php echo $_item->getQty()*1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
            <?php else: ?>
                <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
            <?php endif; ?>
            </td>
            <?php endif; ?>
        </tr>
    <?php endforeach; ?>
    <?php else: ?>
       <tr>
           <td colspan="<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>"><?php echo $this->__('No options of this product are available.') ?></td>
       </tr>
    <?php endif; ?>
    </tbody>
</table>
<script type="text/javascript">decorateTable('super-product-table')</script>
Marco GasiFreelancerCommented:
You should write so:

<td><?php echo $this->html_entity_decode(($_item->getShortDescription())) ?></td>  ?>

Cheers
Ray PaseurCommented:
I see this:

Parse error: syntax error, unexpected '(', expecting ',' or ';' in /home/mrrhythm/public_html/magento/app/design/frontend/base/default/template/catalog/product/view/type/grouped.phtml on line 62


You might want this:

<td><?php echo html_entity_decode($_item->getShortDescription()) ?></td>

It would be helpful to see the "view source" from this:

var_dump($_item->getShortDescription());
Ray PaseurCommented:
Or it might need to be this - with the semicolon.  Not sure but I would use the semi-colon, I think.

<td><?php echo html_entity_decode($_item->getShortDescription()); ?></td>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kmurphychiAuthor Commented:
Hurray!!  It worked.  Thank you so much!  I really appreciate all of your help.
Ray PaseurCommented:
Great!  Thanks for the points.  

Going forward, when you post code here at EE, please use the code snippet.  It gives us line numbers and a uni-space font that is very easy to read.

best of luck with your project, ~Ray
kmurphychiAuthor Commented:
You've got it.  Thanks again!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.