Case:
Suppose we are observing event: catalog_product _collection_ load_before
in some custom page. For example:
class MagePsycho_Custom_Model_Observer
{
public function catalogProductCollectionLoadBefore(Varien_Event_Observer $observer)
{
if (Mage::app()->getFrontController()->getAction()->getFullActionName() == 'some_custom_route')
{
$collection = $observer->getCollection();
$collection->addAttributeToFilter('custom_attribute', 123);
}
}
}
And lets say we have some other blocks which also uses the product collection to display the products, which now becomes empty as the above filter gets added.
How would you safely observe the event in this kind of situation so that it works for both(custom page & blocks)? Please share your views.