2

How to get order total amount in my custom file ?

2
  • Can you please explain in brief. Thanks. Jun 21, 2019 at 5:44
  • check my answer @Lokesh M Jun 21, 2019 at 6:16

2 Answers 2

2

try Following way...

$order = Mage::getSingleton('sales/order')->loadByIncrementId($orderId);

$order->getGrandTotal();
1
  • Its working Thank you Mr.Rakesh :)
    – user80516
    Jun 21, 2019 at 6:28
0

Basically we get order total amount like this :

$order = Mage::getModel("sales/order")->loadByIncrementId($orderId); // get order

$order->getGrandTotal();
6
  • I got the Order_Id.. But can't get order total amount..can you please tell me some other way To get order total amount ?
    – user80516
    Jun 21, 2019 at 6:12
  • This is my code used in controller file $order = Mage::getModel("sales/order")->load($orderId); $totalPrice = $order->getGrandTotal(); echo $totalPrice; exit;
    – user80516
    Jun 21, 2019 at 6:14
  • try with var_dump($order->getData()); to get array for all data. than check. Jun 21, 2019 at 6:14
  • please check again which i update my answer. Jun 21, 2019 at 6:16
  • $order = Mage::getModel("sales/order")->load($orderId); $orders = var_dump($order->getData()); print_r($orders); Output : array(0)
    – user80516
    Jun 21, 2019 at 6:21

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.