fxdesca Posted October 22, 2012 Share Posted October 22, 2012 Hello, I'd like to run a/b test on my website. I have 2 different themes on my ftp: -ThemaA -ThemeB To run the test i need the themeB to be displayed with a different url from themeA. So i guess i have to insert url parameter for themeB, but i really dont know of to do that. Any help please ? Thanks Link to comment Share on other sites More sharing options...
Stanciu Valentin Posted October 23, 2012 Share Posted October 23, 2012 (edited) HI the only way that i could make it work on some websites is with the fallowing way in your config/settings.inc.php you will need to change: define('_THEME_NAME_', 'prestashop'); to if(isset($_GET['ab'])) { define('_THEME_NAME_', 'prestashop_ab'); }else{ define('_THEME_NAME_', 'prestashop'); } but in your url you always need to have the 'ab' paramater. If you found another just let me know Edited October 23, 2012 by Stanciu Valentin (see edit history) 3 Link to comment Share on other sites More sharing options...
fxdesca Posted October 23, 2012 Author Share Posted October 23, 2012 (edited) HI the only way that i could make it work on some websites is with the fallowing way in your config/settings.inc.php you will need to change: define('_THEME_NAME_', 'prestashop'); to if(isset($_GET['ab'])) { define('_THEME_NAME_', 'prestashop_ab'); }else{ define('_THEME_NAME_', 'prestashop'); } but in your url you always need to have the 'ab' paramater. If you found another just let me know First thank you so much for responding. I changed the code as you mentionned. It worked ( you cant imagine how thankful i am for this ) Edit: Now i can reach my "prestasho_ab" theme by adding "?ab" at the end of my url. The thing is, say i type my url to reach theme B : www.myshop.com/furniture/wood-pen?ab when i click a link and navigate away from the page, the ?ab parameter is lost so it comes back to normal template. Is there anyway that when you reach a page with "?ab" parameter, it always keep the parameter and always display the same theme ? I'll let you know if i come up with another solution Edited October 23, 2012 by fxdesca (see edit history) Link to comment Share on other sites More sharing options...
Stanciu Valentin Posted October 24, 2012 Share Posted October 24, 2012 One way to do it but that is a little hard is to override all the Links but that is not a good idea. what else you can do is to use cookies or sessions that you can set and check what cookie is set and based on that to load your theme. But I'm not sure if your cookie will also be deleted when the user will logout, but try it and let me know 1 Link to comment Share on other sites More sharing options...
fxdesca Posted October 24, 2012 Author Share Posted October 24, 2012 One way to do it but that is a little hard is to override all the Links but that is not a good idea. what else you can do is to use cookies or sessions that you can set and check what cookie is set and based on that to load your theme. But I'm not sure if your cookie will also be deleted when the user will logout, but try it and let me know oh ok thanks for the tip. Currently i have no idea of the code i should be using but ill try to figure that out and let you know Link to comment Share on other sites More sharing options...
cliqadam Posted January 21, 2013 Share Posted January 21, 2013 To keep the new template. Set a cookie if "get" finds the ab variable in the link. Than in than in the code above look for get or the cookie. If get or cookie exists change the theme. This way the only way to change the theme to the original one would be by clearing thw cookies in the browser. This way links dont have to be changed. Link to comment Share on other sites More sharing options...
imgs Posted January 26, 2016 Share Posted January 26, 2016 Maybe you try create custom language and set lang1=theme1, lang2=theme2. Language and urls will be remembered (template as well). Link to comment Share on other sites More sharing options...
fxdesca Posted May 17, 2016 Author Share Posted May 17, 2016 Maybe you try create custom language and set lang1=theme1, lang2=theme2. Language and urls will be remembered (template as well). hi ! it was a long time ago that i first post my issue on this topic. but still, thanks fort the tip. i might need to use that for my current job sometimes ! 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