Moutnto Extra Totral在结帐时显示问题

时间:2012-11-01 12:55:03

标签: magento

我在一页结帐时添加了一个额外的总额。我添加了一些工具提示的自定义标题,它工作正常。但是由于我进行了magento升级,它会显示html标签。

enter image description here

1 个答案:

答案 0 :(得分:1)

假设您使用的是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'))