且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento编辑器在添加新产品时自动换行问题

更新时间:2023-11-30 13:08:28

这些其他中断是由nl2br()函数引起的,应该删除.

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

要针对简短说明解决此问题,请打开app/design/frontend/[package]/[theme]/template/catalog/product/view.phtml,找到:

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') ?>

并替换为:

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

要针对描述解决此问题,请打开app/design/frontend/[package]/[theme]/template/catalog/product/view/description.phtml,找到:

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') ?>

来源