Get Order Details using Order ID in Magento

Get Order Details using Order ID in Magento

In this poist wee will how to get Order Details using Order ID in Magento, Here, we will show you, how we can get information about all items in over magento shopping cart based on order id.

hear we will show you, How to Get Order Details using Order ID in Magento or sometimes infomation need to get product it, sku, name , category name, category id. So it is easy to Get Order Details using Order ID in Magento

// your order number
$order_number = 100001124;
// pass order number
$orders = Mage::getModel('sales/order')->loadByIncrementId($order_number);
// get all order total value
$order_value = number_format ($orders->getGrandTotal(), 2, '.' , $thousandssep = '');
// get all order item collection
$orderItems = $orders->getItemsCollection();
 
foreach ($orderItems as $item){
 
	// get product id
    $product_id = $item->product_id;
	// get product sku
    $product_sku = $item->sku;
	// get product Name
    $product_name = $item->getName();
	// get product all detail
    $_product = Mage::getModel('catalog/product')->load($product_id);
	// get product all Category Ids
    $cats = $_product->getCategoryIds();
	// we get only fires name of Category data
    $category_id = $cats[0]; 
    $category = Mage::getModel('catalog/category')->load($category_id);
	// we get only fires name of Category
    $category_name = $category->getName();
 
    // print data of orders
	echo "<br/>category id=".$category_id;
	echo "<br/>product sku=".$product_sku;
	echo "<br/>product name=".$product_name;
    echo "<br/>order number=".$order_number;
	echo "<br/>product id=".$product_id;
    echo "<br/>order Value=".$orderValue;
    echo "<br/>product name=".$product_name;        
    echo "<br/>category name=".$category_name;
 
}

You also like codeigniter select query and codeigniter join tables and Codeigniter Delete Query

Leave a Comment

Your email address will not be published. Required fields are marked *

57  +    =  65

We accept paid advance and paid guest Posting on our Site : Contact US