Magento – Event Observer for Specific Store

event-observermultistorestore-idstore-view

I use this Event Observer on a multistore for a custom URL Structure Manufacturer in product url key.
The problem is now that I need this for only one specific store id. How can I set a custom Event Observer for specific store id?

Best Answer

you can just check inside the observer if you are on the right store view.

public function updateurl($observer)
{
    $storeId = your store id here;
    if (Mage::app()->getStore()->getId() == $storeId) {
        //your code goes here.
    }
}