logart Posted June 18, 2011 Share Posted June 18, 2011 I have various types of products in my system, some of which are better off with the comparison template, and some with other types of templates. I can send visitors to the correct template by adding carttpl= to the URL, but when I do that, all of the other product groups will show up with that same template if they click on other product groups. Is there a way to configure product groups to default to a certain template? Or even specific products? Or do I just have to deal with the customers seeing non-optimal templates for product groups? 0 Quote Link to comment Share on other sites More sharing options...
vcolina Posted February 16, 2012 Share Posted February 16, 2012 Hi Logart, how are you? Did you ever solve this? I'm looking for the same thing. Thanks. 0 Quote Link to comment Share on other sites More sharing options...
logart Posted February 16, 2012 Author Share Posted February 16, 2012 No help from anyone. 0 Quote Link to comment Share on other sites More sharing options...
tripler Posted February 16, 2012 Share Posted February 16, 2012 We did all this with our site by creating a design/coding it and implementing whmcs and its code into it, not taking whmcs and making something around it. I suggest hiring someone to make a template if you want options to change the front end of whmcs. Theres no simple solution. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted February 17, 2012 Share Posted February 17, 2012 (edited) A bit of a hack, but heres some working code you can add to the top of your whmcs header.tpl file. Just need to modify the switch statement to reflect your group id's and which templates you want to load with them. {if $gid} <script> {literal} var gid = {/literal}{$gid}{literal}; switch (gid) { case 1: var carttpl = 'boxes'; break; case 2: var carttpl = 'web20cart'; break; default: var carttpl = 'modern'; break; } var dontreload = 0; var cartset = 0; var output = []; var qs = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i < qs.length; i++) { var q = qs[i].split('='); if (q[0] == 'carttpl') { cartset = 1; output.push('carttpl='+carttpl); if (q[1] == carttpl) { dontreload = 1; } } else { output.push(q[0]+'='+q[1]); } } if (!cartset) { output.push('carttpl='+carttpl); } var url = window.location.href.substr(0, window.location.href.indexOf('?'))+'?'+output.join('&'); if (!dontreload) { location.href = url; } {/literal} </script> {/if} EDIT: This has not been fully tested and probably has at least a bug or two. use at your own risk. Edited February 17, 2012 by laszlof 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.