1

I am setting up a store view for my mobile app which I am going to strip away the header and footer along with some other customisation.

After creating a store view and then going to it I have noticed that going to the main URL: www.example.com will not go back to the default store view.

This will cause a problem with people using the app then going to the website using there mobile browser.

How can I make the main domain the default store view?

0

This is a bit tricky, and Magento doesn't provide much to help with things like this. The way I see it, you have a couple options:

  • I'm not sure what you mean when you refer to your "mobile app", but I'm assuming that it is a Cordova-like app that embeds your web page into the app. In that case, depending on the tools that your app framework provides for controlling the request made to the server, you may be able to pass in a special user agent header, that you could then filter as an exception in System->configuration->design.

  • Your other option is to pass some kind of request parameter into the url, and then check it in the controller_action_predispatch event, or any other event fired before the request is handed off to the controller action method. You can set a flag with the registry, or something else, that you would then refer to later to determine which theme/layout/content to load.

  • Hey do you know how to remove the store switcher on the top of the website without removing the store view? – Mike Tim Turner Oct 12 '16 at 13:14
  • One thing you could do for that is use CSS to set it to display: none;. You could also remove the block in layout, but I'm not sure whether the store view functionality would continue to work... I don't think so. – tjons Oct 12 '16 at 13:15
  • Did the answer help? – tjons Oct 12 '16 at 13:15

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.