Jump to content

Auto direct to mobile skin


ayz1

Recommended Posts

I would like to direct a customer to the mobile skin automatically depending on the screen size of the device they are viewing it on. Has anyone any idea how this can be done?

 

Also I know there is a responsive skin in development, does anyone have any thoughts on how this should be done? Should it be one website with different css files for the different screen sizes or a separate mobile folder as it is now? Personally I would prefer the latter as it will be easier to customize but guess it is harder to implement and upgrade as both folders would need to be updated. I would appreciate any input on the pros and cons of each method if anyone would like to discuss it.

Link to comment
Share on other sites

Hi Al

 

Thanks for that. The mobile skin I'm using for instance only has 7 products on the main page but my desktop site has 24. As I'm using the mobile skin that comes with Cubecart I have to hard code the products in so if they go out of stock then they don't auto generate new content (probably down to my lack of coding knowledge). One thing that would be good is the ability to select the number of products on the mobile page. Will that be possible? Also will you be keeping the mobile site in it's own folder as it is now or moving to just the one main set of skin files?

 

I've tried this

 

<script type="text/javascript">
<!--
   if (screen.width <= 699) {
   document.location = "http://www.mysite.com/index.php?display_mobile=1";
}
//-->
</script>

 

which seems to work but the link at the bottom of the page switching from mobile to desktop obviously doesn't work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...