Hi guys i have a collection in which i add custom data to. I am then trying to filter the collection by one of the original fields but it doesn't seem to work.
Here is my collection building code:
$collection = $this->getCollection();
$collection->getSelect()->join(
'sales_flat_order',
'sales_flat_order.entity_id = main_table.magento_order_entity_id',
array('increment_id')
);
foreach($collection->getItems() as $item){
$status = $this->getState($item->getId());
$item->addData(array('response_state' => $status));
}
return $collection;
This builds the collection successfully but when i try to use addFieldToFilter() to the collection it doesn't filter at all.
Here is the filter code:
->addFieldToFilter('is_successful', array('eq' => $value));
Anyone know why and how i can get this to work? Cheers
$item->setResponseState($status)
and->addFieldToFilter('is_successful', $value)
instead.