<?php
foreach($this->getTotals() as $total)
{
if ($total->getCode() == 'subtotal')
{
$subtotal = $total->getValue();
break;
}
}
echo $subtotal;
?>
有什么办法可以直接得到小计?
最佳答案
根据 this site :
You can get the subtotal with:
$totals = Mage::getSingleton('checkout/cart')->getQuote()->getTotals(); $subtotal = $totals["subtotal"]->getValue();
关于Magento 结帐 : Get Subtotal Value without iterating,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2245436/