gpt4 book ai didi

php - Magento 中的购物车总计不含运费

转载 作者:行者123 更新时间:2023-12-02 05:16:08 25 4
gpt4 key购买 nike

这是我的代码:

public function TOTALCODE () 
{
if ($parentBlock = $this->getParentBlock())
{
$amount = __(number_format(Mage::getSingleton(’checkout/session’)->getQuote()->getGrandTotal(), 2, ‘,’, ‘.’));
$text = __(’€ %s (incl. 21% btw)’, $amount);
$parentBlock->addLink($text, ‘checkout/cart’, $text, true, array(), 50,null,’class="top-link-cart"’);
}

如何让它显示总计而不包含运费?

最佳答案

算了算了。

$subtotal = Mage::getSingleton('checkout/session')->getQuote()->getGrandTotal() - Mage::getSingleton('checkout/session')->getQuote()->getShippingAmount ()

关于php - Magento 中的购物车总计不含运费,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14608301/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com