0

I need to export sales/order list from magento to an external DB. I use this:

    Mage::app()->getStore()->setId(20);
    $orders = Mage::getModel('sales/order')
        ->getCollection()

I used print_r($orders->getData()); to see all the fields that I need to export but in this list there aren't all the fields that magento show me in the admin panel. where/how can I find them ?

1 Answer 1

0

Along with $order->getData(); use following also for more informations

Use $order->getBillingAddress() for billing address details

echo "<pre>"; print_r($order->getBillingAddress()->getData());

Use $order->getShippingAddress() for shipping address details

echo "<pre>"; print_r($order->getShippingAddress()->getData());

Use $order->getPayment() for Payment method details

echo "<pre>"; print_r($order->getPayment()->getMethodInstance()->getData());

Use $order->getShippingAddress()->getShippingMethod() for Shippment method details

echo "<pre>"; print_r($order->getShippingAddress()->getShippingMethod()->getData());
1
  • thank you this is helpful, i'm wondering now if there's a fast way to get all the fields because in this way it shows a lot of data that i don't need to use Commented Dec 1, 2015 at 11:42

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.