This is my collection code:

$collection = Mage::getResourceModel('sales/order_collection')
        ->join(array('a' => 'sales/order_address'), 'main_table.entity_id = a.parent_id AND a.address_type != \'billing\'', array(
            'city'       => 'city',
            'country_id' => 'country_id'
        ->join(array('c' => 'customer/customer_group'), 'main_table.customer_group_id = c.customer_group_id', array(
            'customer_group_code' => 'customer_group_code'
             array('customer_mail' => 'main_table.customer_email'))
        ->addFieldToFilter('status', array('in' => array(

It gets all orders that are in state ON HOLD. Now I want to exclude those orders that are not in state ON HOLD X days later. The identification should be the mail address which is included in the collection already.

So, whenever a customers still wasnt able to order X days later, the order should be in that collection. How would I do that?


Your Answer

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

Browse other questions tagged or ask your own question.