【问题标题】:How to show the original price in the shopping cart in Magento如何在 Magento 的购物车中显示原价
【发布时间】:2012-04-29 00:36:11
【问题描述】:

我在尝试在 Magento 的购物车中显示原始单价时遇到问题。默认情况下,Magento 只显示特价,但我也想显示原价以突出节省。

我知道哪个模板需要更改,即 /template/checkout/cart/item/default.phtml。

在第 145 行显示

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

显示特价。我只是不知道显示原价的语法。

【问题讨论】:

    标签: magento shopping-cart


    【解决方案1】:

    另一种方法见下文, 我不确定 $_item->getPrice 是否可以访问非特价,所以将其跳转到产品

                <?php echo $_item->getProduct()->getPrice(); ?>
    

                 <?php foreach($this->getItems() as $_item): ?>
                 <?php echo $this->getItemHtml($_item) ?>
            // insert it here
                 <?php endforeach ?>
    

    【讨论】:

    • 谢谢,我不太确定您建议编辑哪个模板,但您的回复确实帮助我想出了以下效果很好的解决方案:
    • getProduct()->getSpecialPrice()): ?> helper('结帐')->formatPrice($_item->getProduct()->getPrice()); ?>
    猜你喜欢
    • 2015-01-01
    • 2013-11-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-18
    • 2015-01-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多