gpt4 book ai didi

magento - 如何在magento的感谢页面中获取税额

转载 作者:行者123 更新时间:2023-12-02 10:29:20 25 4
gpt4 key购买 nike

我正在尝试从总金额中扣除税额,或者仅获取小计金额,以便我可以将其放入附属链接中,但最后我无法获取税额或小计金额客户单击下订单按钮后的感谢页面。我尝试过:

 <?php echo $_product->getData('tax_amount'); ?> 

  $totalItemsInCart = Mage::helper('checkout/cart')->getItemsCount(); //total items in cart
$totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object
$subtotal = round($totals["subtotal"]->getValue()); //Subtotal value
$grandtotal = round($totals["grand_total"]->getValue()); //Grandtotal value


if(isset($totals['tax']) && $totals['tax']->getValue()) {
$tax = round($totals['tax']->getValue()); //Tax value if present
} else {
$tax = '';
}

echo $tax;

但运气不佳;我无法获得税额,我只能获得税额小计。

最佳答案

Mage::helper('checkout')->getQuote()->getShippingAddress()->getData('tax_amount')

在这里您将获得您的税额

关于magento - 如何在magento的感谢页面中获取税额,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16219824/

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