如何在我的自定义模块中获取当前会话的小计金额

时间:2014-06-05 13:46:41

标签: magento

如何获得在magento条件下的小册子总数。
实际上我通过一个教程参考下面是链接。

http://excellencemagentoblog.com/magento-add-fee-discount-order-total

 if(Excellence_Fee_Model_Fee::canApply($address)){

                $TotalsData = $address->getTotals();

                $exist_amount = $quote->getFeeAmount();
                $fee = Excellence_Fee_Model_Fee::getFee();
                $balance = $fee - $exist_amount;
                //$balance = $fee;

                //$this->_setAmount($balance);
                //$this->_setBaseAmount($balance);

                $address->setFeeAmount($balance);
                $address->setBaseFeeAmount($balance);

                $quote->setFeeAmount($balance);

                $address->setGrandTotal($address->getGrandTotal() + $address->getFeeAmount());
                $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseFeeAmount());              
            }

1 个答案:

答案 0 :(得分:1)

Vivek试试这个

$address->getSubtotal();

OR

 totals = Mage::getSingleton('checkout/cart')->getQuote()->getTotals();


     $subtotal = $totals["subtotal"]->getValue();