0

I have override Mage_Sales_Model_Quote_Address_Total_Abstract with my custom model to add and display custom additional fee to user but i am not getting the subtotal value in it.

I have used $address->getSubTotal() and it is returning zero.

Help me to get subtotal.

Thanks

1
  • i want it in collect method.i have override collect method with following singnature. public function Collect(Mage_Sales_Model_Quote_Address $address) Commented Oct 15, 2013 at 12:24

2 Answers 2

1

Subtotal is calculated right before grand total. This means if your total is caluclated before the subtotal, there is no subtotal to get.

4
  • 1
    thanks Fabian Blechschmidt. i have to add <after>subtotal</after> in config to load my model after subtotal. Commented Nov 12, 2013 at 18:31
  • i have add added after subtotal but not getting subtotal Commented Feb 10, 2014 at 11:45
  • not working for me :(
    – Arvind07
    Commented Jan 19, 2016 at 7:17
  • This is not helpful. Learn how to debug. Learn to get more infos and ask the right questions: magento.stackexchange.com/questions/428/fundamentals-for-debugging-a-magento-store Commented Jan 19, 2016 at 7:41
0

Subtotal can be found using:

$subtotal = $address -> getTotalAmount('subtotal');

It worked for me.

Your Answer

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

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