How to get order total amount in my custom file ?
2 Answers
try Following way...
$order = Mage::getSingleton('sales/order')->loadByIncrementId($orderId);
$order->getGrandTotal();
-
Its working Thank you Mr.Rakesh :)– user80516Jun 21, 2019 at 6:28
Basically we get order total amount like this :
$order = Mage::getModel("sales/order")->loadByIncrementId($orderId); // get order
$order->getGrandTotal();
-
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 ?– user80516Jun 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;
– user80516Jun 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
-
-
$order = Mage::getModel("sales/order")->load($orderId); $orders = var_dump($order->getData()); print_r($orders);
Output : array(0)– user80516Jun 21, 2019 at 6:21