Question

In onepage checkout, I am trying to get Grand Total but it is not updated based on shipping charges, taxes applied instead it is only showing product cost.

After selecting the shipping method and reloading the page is updating grand total correctly but I wanted to update grand total in the step payment information.

Can anybody please help me with this?

Was it helpful?

Solution

Try

$quote = Mage::getModel('checkout/session')->getQuote();
$quoteData= $quote->getData();
$grandTotal=$quoteData['grand_total'];

OR

print_r(Mage::helper('checkout')->getQuote()->getData());

OTHER TIPS

You can get the grand total by using this:

$grandTotal = Mage::getModel('checkout/session')->getQuote()->getGrandTotal();

Here is my solution and I hope this helps anyone who needs it.

By default Shipping is not added to the grandTotal until after you select your payment method. To add it after you select your shipping method go to this file.

app/design/frontend/base/default/template/checkout/onepage/payment.phtml

The code at the top is this:

var quoteBaseGrandTotal = getQuoteBaseGrandTotal(); ?>;
var checkQuoteBaseGrandTotal = quoteBaseGrandTotal;

Its picking up the BaseGrandTotal, so you simply have to switch it to GrandTotal like this:

var quoteGrandTotal = getQuoteGrandTotal(); ?>;
var checkQuoteGrandTotal = quoteGrandTotal;

Now your shipping will be add the the GrandTotal, as BaseGrandTotal excludes the shipping costs.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top