I had added a custom option Complete
in action dropdown(sales->orders). It's working fine and order status changes to complete successfully.
I am integrating all orders with Salesforce
. I have need of all of order details by orderid
. Item details and grand total is fetched successfully.
Can anyone please help to fetch Customer
name and his/her company name how submitted order. Below is my complete code to fetch order details:
$order = Mage::getModel('sales/order')->load($orderId);
$items = $order->getAllItems();
$_totalData = $order->getData();
$_grand = $_totalData['grand_total'];
$custname = $_totalData->getCustomerName();
$itemcount=count($items);
foreach ($items as $itemId => $item)
{
$sObject2->Item_name__c = $item->getName();
$sObject2->Unit_price__c = $item->getPrice();
$sObject2->Sku__c = $item->getSku();
$sObject2->Quantity__c = $item->getQtyToInvoice();
}