ozgurerdogan Posted May 28, 2015 Share Posted May 28, 2015 I know it is not added but wondering if anyone has a way to accomplish sorting products or domains in users summary page? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted May 29, 2015 WHMCS Support Manager Share Posted May 29, 2015 Hi, Only 4 votes in 2 years for this idea so far I'm afraid: https://requests.whmcs.com/responses/in-client-summary-enable-filter-sort-status-from-products-services But feel free to add your voice to this suggestion, every vote counts! 0 Quote Link to comment Share on other sites More sharing options...
ozgurerdogan Posted May 29, 2015 Author Share Posted May 29, 2015 I believe this is even not something to vote to add it to whmcs. It is mostly a standart on all table listing things. So whmcs itself should already have had it. Also it is not a hard work to apply is it? It is just a sorting feature... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2015 Share Posted May 29, 2015 which page are you talking about... and sort in what way?? 0 Quote Link to comment Share on other sites More sharing options...
ozgurerdogan Posted May 29, 2015 Author Share Posted May 29, 2015 Products or domains in clients summary page.. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 30, 2015 Share Posted May 30, 2015 I wasn't sure if you meant the client summary in the admin area, or the product/domain summary page of the client area - but i'm going to assume you mean the admin area as the tables in the client area are sortable. in the absence of WHMCS making these summary tables sortable, what you could do is modify the clientssummary.tpl template using the sortby Smarty plugin. http://forum.whmcs.com/showthread.php?95519-temporarilly-change-sorting-of-items&p=400690#post400690 you could then modify the template to either hard code a sort option for each summary section - or even add links to the table column headings to allow sorting by any column. e.g if you wanted to always display a client's domains in alphabetical order, you could do this... {foreach key=num from=$domainsummary|@sortby:domain item=domain} because it's sorting by string or numerically, it doesn't work well with dates (unless they're in a YYYY/MM/DD format) or currencies - but if you only want to sort by text fields and/or numbers, it should work fine. the idea should work on any of the tables on the summary page - domains, products, addons etc. also, this should continue to work with v6 too (works on beta4). 0 Quote Link to comment Share on other sites More sharing options...
ozgurerdogan Posted May 30, 2015 Author Share Posted May 30, 2015 Actually I need to sort by dates mostly. So that would not help me.. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 31, 2015 Share Posted May 31, 2015 Actually I need to sort by dates mostly. So that would not help me.. you never mentioned sorting by date previously! actually, it will help you in one respect - you now know that summary page uses a template. therefore, all you will need to do is replace the current array(s) and generate your own, either in a php block or action hook, by querying the appropriate database tables and ordering by whichever date you want to sort by, and then tweak the foreach loop of the table(s) you want to sort. 0 Quote Link to comment Share on other sites More sharing options...
BuffaloWeb Posted July 19, 2015 Share Posted July 19, 2015 {foreach key=num from=$domainsummary|@sortby:domain item=domain} also, this should continue to work with v6 too (works on beta4). Replacing existing line: {foreach key=num from=$domainsummary item=domain} with what you suggested breaks the template... Too bad, I would have liked to use that! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 19, 2015 Share Posted July 19, 2015 Hi, in v6.01, using the following code still works for me... {foreach key=num item=domain from=$domainsummary|@sortby:domain} what you might be doing wrong is where you are putting the Smarty plugin - the above code was written for v5; with v6, a lot of the directories have moved - so for v6, the above plugin now needs to go in... /vendor/smarty/smarty/libs/plugins/ 0 Quote Link to comment Share on other sites More sharing options...
BuffaloWeb Posted July 19, 2015 Share Posted July 19, 2015 thanks, but I am still on last v5 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 19, 2015 Share Posted July 19, 2015 thanks, but I am still on last v5 so am I - and it definitely works on v5.3 too! where did you upload the plugin? 0 Quote Link to comment Share on other sites More sharing options...
BuffaloWeb Posted July 19, 2015 Share Posted July 19, 2015 per other thread (and in case someone finds THIS thread in the future): I moved the plugin from /public_html/billing/includes/smarty/plugins to /public_html/xxxxx/includes/classes/Smarty/plugins and gee whiz, it works now! 0 Quote Link to comment Share on other sites More sharing options...
BuffaloWeb Posted August 24, 2015 Share Posted August 24, 2015 So I updated to 6.02, and moved the modifier.sortby.php file to /vendor/smarty/smarty/libs/plugins. I have the following code in clientsummary.tpl which no longer seems to sort correctly: {foreach key=num from=$domainsummary item=domain|@sortby:"status,expirydate,domain"} Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 24, 2015 Share Posted August 24, 2015 Hi, as per post #10, the sortby is attached to 'from' and not 'item' - so it should be... {foreach key=num from=$domainsummary|@sortby:"status,expirydate,domain" item=domain} also, bear in mind what I said in post #6 in that it doesn't work well with dates (unless they're in YYYY/MM/DD format) or currencies. 0 Quote Link to comment Share on other sites More sharing options...
BuffaloWeb Posted August 24, 2015 Share Posted August 24, 2015 Thanks Brian, works like a charm now! 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.