1

I have this code in a custom module

Mage::getSingleton("checkout/cart")->getQuote()->getGrandTotal()

Which table and which column does this code getting data from?

First I thought it was the field grand_total from sales_flat_quote, but it's not?

1 Answer 1

2

For this code below table used

sales_flat_quote

and Feild used is of this table

grand_total

Edit

If you look at this file

app/code/core/Mage/Sales/etc/config.xml

then this is the same table is used for sales/quote

Check this way

 Mage::getSingleton("checkout/cart")->getQuote()->getId();

and check grand_total at that Id

8
  • I also think it's the grand_total. but when I manually updated the grand_total to 0, the code still getting me some numbers. that's I'm confused if it is the grand_total that is used. how come it's not getting the number I manually wrote in the DB. And I'm sure it is the correct entity_id I edited with. Nov 29, 2017 at 11:51
  • @xxx What is your requirement Nov 29, 2017 at 11:57
  • A custom module that I'm working on, is calculating the amount wrong when Gift Voucher applied. If it's 100% discount, it doesnt remove the tax from shipping cost. so the total amount customer need to pay is the tax of the shipping cost, which the amount should be 0 since it's a 100% giftcard. I end up with the code above, and try to modify the grand_total to 0 if it's 100% giftcard. it it's now working. that's why Im confused. Nov 29, 2017 at 12:02
  • 1
    @xxx this will update the quote but need to check if magento chabge value after your code or not Nov 29, 2017 at 12:13
  • 1
    @xxx app/code/core/Mage/Sales/Model/Quote/Address/Total/Grand.php collect method change setGrandTotal Nov 29, 2017 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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