Magento 删除<;span class=";价格“&燃气轮机;价格标签

Magento 删除<;span class=";价格“&燃气轮机;价格标签,magento,Magento,如何从中删除/关闭… <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?> 在 我将上一个参数更改为false,并在没有… 所以我想知道我能在这里做些什么 <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?&

如何从中删除/关闭

<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>


我将上一个参数更改为false,并在没有
所以我想知道我能在这里做些什么

<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>

我不想改变核心文件。
Thx以获取帮助。

您必须将签出帮助程序(Data.php)重写到您的命名空间中,以覆盖此函数:

public function formatPrice($price)
{
    return $this->getQuote()->getStore()->formatPrice($price);
}
换成

public function formatPrice($price,$includeContainer = false)
{
    return $this->getQuote()->getStore()->formatPrice($price,$includeContainer);
}
那么你只需要这个:

<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?

要覆盖此函数,必须将签出帮助程序(Data.php)重写到您的命名空间中:

public function formatPrice($price)
{
    return $this->getQuote()->getStore()->formatPrice($price);
}
换成

public function formatPrice($price,$includeContainer = false)
{
    return $this->getQuote()->getStore()->formatPrice($price,$includeContainer);
}
那么你只需要这个:

<?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?
只需在PHP中使用
带标签()

只需在PHP中使用
带标签()

在Magento中,使用

Mage::helper('checkout')->formatPrice($price);
要获取本地格式的$price,它将打印由
括起的$price。在某些情况下,这不是很实际。如果您不太喜欢此
标记,可以使用以下方法:

Mage::helper('checkout')->getQuote()->getStore()->formatPrice($price, false);

在Magento中,使用

Mage::helper('checkout')->formatPrice($price);
要获取本地格式的$price,它将打印由
括起的$price。在某些情况下,这不是很实际。如果您不太喜欢此
标记,可以使用以下方法:

Mage::helper('checkout')->getQuote()->getStore()->formatPrice($price, false);

这正是我所需要的。我认为这应该是实际的答案。它执行起来既快又干净。没有必要为了超越功能而乱放额外的文件。只想说这真的帮了我很多。使用此解决方案,您无需更改magento核心文件。非常感谢你!这正是我所需要的。我认为这应该是实际的答案。它执行起来既快又干净。没有必要为了超越功能而乱放额外的文件。只想说这真的帮了我很多。使用此解决方案,您无需更改magento核心文件。非常感谢你!