davidgamo Posted October 31, 2011 Share Posted October 31, 2011 I want to show a different theme depending on a file/url: www.web.xxx -> Prestashop Theme www.web.xxx/mobile -> mobile Theme How can I do it? Link to comment Share on other sites More sharing options...
Santscho Posted November 24, 2011 Share Posted November 24, 2011 I also want to know this Link to comment Share on other sites More sharing options...
CartExpert.net Posted November 25, 2011 Share Posted November 25, 2011 Hello! You can have different theme for mobile version, but it requires coding. You can also have a second shop for mobile and use htaccess redirect in case of mobile device. Regards, The CartExpert Team Link to comment Share on other sites More sharing options...
davidgamo Posted November 26, 2011 Author Share Posted November 26, 2011 I have created a new theme for mobile devices. What code is necessary? I want that every user can choose between the themes, with only one shop. Or I would like: www.web.xxx?theme_name= to change the theme, for the user. 1 Link to comment Share on other sites More sharing options...
Santscho Posted December 17, 2011 Share Posted December 17, 2011 @davidgamo Did you find a solution for this problem? Link to comment Share on other sites More sharing options...
davidgamo Posted December 31, 2011 Author Share Posted December 31, 2011 Nooo.. Could you help me? Link to comment Share on other sites More sharing options...
CartExpert.net Posted January 3, 2012 Share Posted January 3, 2012 Hello! To use different themes you need to edit the settings.inc.php and define the _THEME_NAME_ depending on the URL. Link to comment Share on other sites More sharing options...
davidgamo Posted January 23, 2012 Author Share Posted January 23, 2012 But, How can I do it? I need the code. Thanks. Link to comment Share on other sites More sharing options...
CartExpert.net Posted January 25, 2012 Share Posted January 25, 2012 Hello, You can download the script to detect mobile phone from: http://detectmobilebrowsers.mobi/ Include the file in settings.php.inc and use an if statement to set the theme. Link to comment Share on other sites More sharing options...
davidgamo Posted April 9, 2012 Author Share Posted April 9, 2012 But, when I change the theme in the admin panel, the file settings.php.inc is created automatically (the code is overriden). What can I do? Link to comment Share on other sites More sharing options...
Dh42 Posted April 10, 2012 Share Posted April 10, 2012 If you are not wanting a totally new design for mobile views, just something that works better on mobile devices use media queries Link to comment Share on other sites More sharing options...
davidgamo Posted April 10, 2012 Author Share Posted April 10, 2012 I don't understand you. I have to use two different themes. One theme for mobile devices and the other one for laptop, PC, etc.. I modified the settings.php.inc file (adding the script): ... require_once('mobile_device_detect.php'); $mobile = mobile_device_detect(); if($mobile==true){ define('_THEME_NAME_', 'mobile'); }else{ define('_THEME_NAME_', 'prestashop'); } ... But this is a good solution if I don't change the theme with the administration panel, because the settings.php.inc file is overwritten. If I set the readonly attribute to the file, I cant change the theme, with the administration panel. Link to comment Share on other sites More sharing options...
CartExpert.net Posted April 11, 2012 Share Posted April 11, 2012 I don't understand you. I have to use two different themes. One theme for mobile devices and the other one for laptop, PC, etc.. I modified the settings.php.inc file (adding the script): ... require_once('mobile_device_detect.php'); $mobile = mobile_device_detect(); if($mobile==true){ define('_THEME_NAME_', 'mobile'); }else{ define('_THEME_NAME_', 'prestashop'); } ... But this is a good solution if I don't change the theme with the administration panel, because the settings.php.inc file is overwritten. If I set the readonly attribute to the file, I cant change the theme, with the administration panel. Hello, yes, that is the downside of this solution. If it doesn't suit your needs you will need to implement a different solution for setting the theme folder. As _THEME_NAME_ is a constant you can not change the value on run-time, so you will need to change the source code of every file which uses _THEME_NAME_ . Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now