0

I Want to show the number of COD and prepaid orders on vendor panel dashboard. Can any body please help me how to do it and code for the same. I am using ced commerce marketplace extension.

1 Answer 1

0

You can the order collection by and then add filter to get the desired collection than from the collection you can get the count.

$collection = Mage::getModel('sales/order')->getCollection()
    ->join(
        array('payment' => 'sales/order_payment'),
        'main_table.entity_id=payment.parent_id',
        array('payment_method' => 'payment.method')
    );

then you can add filter

$collection->addFieldToFilter('payment.method', array(array('nlike' => 'paypal')))
->addFieldToFilter('state', array(array('like' => 'processing')));

or

$collection->addFieldToFilter('payment.method', array('neq' => 'paypal'))
->addFieldToFilter('state', 'processing')

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.