我已经在一个页面上添加了一个额外的总数结帐.I添加了一些工具提示自定义标题,它工作得很好。但自从我升级magento后,它显示的是html标签。

发布于 2012-11-02 00:12:01
假设您使用的是magento v1.7+
查看一下您的全部模板/app/design/frontend/base/default/template/checkout/total/default.phtml
Magento使用$this->escapeHtml()对html进行转义
<?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?>
<?php echo $this->escapeHtml($this->getTotal()->getTitle()); ?>
<?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?>查看/app/code/core/Mage/Core/Block/Abstract.php
public function escapeHtml($data, $allowedTags = null)
{
return $this->helper('core')->escapeHtml($data, $allowedTags);
}要解决此问题,您可以删除$this->escapeHtml()或$this->escapeHtml($this->getTotal()->getTitle(), array('span','a'))
https://stackoverflow.com/questions/13177546
复制相似问题