I'm loading a collection of order items like this:
$collection = Mage::getResourceModel('sales/order_item_collection')
->addAttributeToSelect('*');
And I'd like to join to add the order's status to the collection, so that I can filter out incomplete orders via addFieldToFilter('status', 'complete')
.
How do I join these two things so that I can filter on the parent order's status?
I would paste my various attempts but I think that would probably just add confusion.
Best Answer
You can use the
join
method on thegetSelect
objectSmall side note, it's better to specifically state which fields you need instead of using
addAttributeToSelect('*')