简体   繁体   中英

Magento Cart Inclusive Price

How do i get the magento total cart inclusive price? I found something like this:

$_product = Mage::getModel('catalog/product')->load($productId);
$_priceIncludingTax = Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice());

but it only gets the price per product which i want is the total inclusive price in the cart.

you can use this methods to display subtotal with inclusive of tax

$this->helper('checkout')->formatPrice($this->getTotal()->getValueInclTax();

if you are outside of cart page then use below steps

$quote = Mage::getModel('checkout/session')->getQuote();
$cartGrossTotal = 0;
foreach ($quote->getAllItems() as $item) {
 $cartGrossTotal += $item->getPriceInclTax()*$item->getQty();
}
echo $cartGrossTotal;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM