3

Magento CE 1.7.0.2 に新しい製品を追加しています。Short Description属性に HTML コードを入力しました。

私の問題:<br>これらの余分なものがどこから来るのか本当にわかりません。WYSIWYG エディターでさえこれらを表示<br>していませんが、Web サイトの製品ページには表示されています。助けてください。

入力内容:

<p>Product Description:</p>
<table border="1" cellspacing="0" cellpadding="5px">
    <tr>
        <td>Category</td>
        <td>Specials</td>
    </tr>
    <tr>
        <td>Texure</td>
        <td>Digitally Printed on High Quality Matte Paper</td>
    </tr>
</table>

表示内容:

<p>Product Description:</p>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<table border="1" cellspacing="0" cellpadding="5px">
    <tr>
        <td>Category</td>
        <td>Specials</td>
    </tr>
    <tr>
        <td>Texure</td>
        <td>Digitally Printed on High Quality Matte Paper</td>
    </tr>
</table>
4

1 に答える 1

2

These additional breaks are caused by nl2br() function that should be removed.

To resolve this for short description, open app/design/frontend/[package]/[theme]/template/catalog/product/view.phtml, find:

<?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>

and replace this by:

<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>

To resolve this for description, open app/design/frontend/[package]/[theme]/template/catalog/product/view/description.phtml, find:

<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), nl2br($_description), 'description') ?>

and relace this by:

<?php echo $this->helper('catalog/output')->productAttribute($_product, $_product->getDescription(), 'description') ?>

Source

于 2016-01-08T16:13:19.593 に答える