I need to create separate website for handheld devices and desktop. For that I created a module to make an observer for the event of controller_action_predispatch. My config.xml observer snippet is as follows.


In Observer.php I've written script to check device type and based on result I set the store. Code snippet is as follows

if($handheldDevice) {
Mage::app()->setCurrentStore('mobile_view'); //It's my store view code

It's switching store fine. I can set different home page for each store and categories too. All cms pages, cart page also seem good. But when I click a category, I'm getting oops error page. Why is it so? (Category is active in admin).

Can anyone help here?


Try going to the category url with the normal Magento way to change storeviews: www.url.com/?___store=storecode.

If that also fails, it is certainly a configuration issue and not something related to yourmodule.

| 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.