On the first visit i have to redirect the user to relative store view depending on the user's country (retrieved by IP).

I want to create a custom module for this purpose, so i think to need a magento event dispatched "before all" so i could set the right store view programmatically.

Is there an event that can afford to do this?


You have to use the first event dispatched controller_action_predispatch.

In the observer you could retrieve user's country with geo localization then redirect the user to the relative store.

More you have to set a cookie and session variable to complete your localization and redirection logic, take hint from here https://expressionengine.stackexchange.com/questions/9347/redirect-user-based-on-country

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.