Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have to export the orders to a file, here is my code to go through the orders:

    $orders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToSelect(array('status', 'ncm'))
    ->addFieldToFilter(
        array(
            array('attribute' => 'status', 'eq' => 'complete')
        )
    );

    $order = $orders->getFirstItem();

    //print_r($order);
    //exit;
    //foreach($orders as $order){
    $id = $order->getIncrementId();

    $payment = $order->getPayment();
    $method = $payment->getMethodInstance();

    print_r($payment);
    //}

I need to print some information about the payment like the method, the amount, how many months it was split, if was credit card, i need the reutrning id of the transaction and so the list goes on

how can I do that?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
369 views
Welcome To Ask or Share your Answers For Others

1 Answer

I think it will be

   $payment = $order->getPayment();

It will retrieve the current order payment instance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...