5

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 in this?

  • Can you please show ur code? – Amit Bera Dec 3 '15 at 9:21
7

Try

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

OR

print_r(Mage::helper('checkout')->getQuote()->getData());
  • I tried this only but it will not give you updated grand total, it excludes shipping charges, taxes, etc in the step of payment information.. And if I reload the page at the very moment, then it updates the grand total. Is there any way so that while moving to step payment information, it refreshes the grand total to calculate accordingly – Anurag Khandelwal Dec 3 '15 at 9:32
  • edited my answer try that also. – Akhilesh Patel Dec 3 '15 at 9:38
  • Thanks a lot man, it worked!! print_r(Mage::helper('checkout')->getQuote()->getData()); – Anurag Khandelwal Dec 3 '15 at 9:48
  • Why getting the full data array? What about $quote->getGrandTotal() or $quote->getData('grand_total')? – 7ochem Dec 3 '15 at 9:49
  • yes you can use $quote->getGrandTotal() – Akhilesh Patel Dec 3 '15 at 9:50
4

You can get the grand total by using this:

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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.