1

i am getting order from magento using this query which is fine

$orders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('created_at', array('from'=>$fromDate, 'to'=>$toDate));

currently i am getting order for all status but i want skip those ordres which oreder status is Exclusions :

Order with any of the following status :

Cancelled
On Hold
Complete
Closed
Payment Review
PayPal Cancelled Reversal
PayPal Reversed
Pending
Pending Payment
Pending PayPal

how i acheive by query

0
$skipStatuses = array(list all your status codes you want to skip here)
$orders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('created_at', array('from'=>$fromDate, 'to'=>$toDate))
    ->addAttributeToFilter('status', array('nin' => $skipStatuses));
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.