Jump to content

Display active products by default


artaweb

Recommended Posts

Hello,

I believe this question must've been asked already but I haven't found any right answer to get it working. In Domains and Products pages, by default all items regardless of its status is shown to the clients. 

Statuses like: Active, Canceled, Terminated, Fraud, etc. 

Now we know that for productivity it makes more sense to only display the active products and well, add an option (which already is there) to filter other items based on their status. We have many customers who has more than 20 services but perhaps just a few are active. For a users like them, its hard to have quick peek at their items. So they have to either search, change the status manually or use the pagination. 

Archiving non-active items can be a great feature for whmcs, user can archive what is not active in their account but I believe such features takes work and effort to be built.

___

I think something like showing the active item by default would be more reasonable than creating a feature for archiving. 

This is the piece of code in clientareaproducts.tpl for products:

                        <ul class="dropdown-menu" role="menu">
                            <li><a href="#"><span data-value="all">{$rslang->trans('generals.all_entries')}</span></a></li>
                            {foreach key=num item=status from=$RSHookServicesStatuses}
                                <li><a href="#"><span data-value="{$status.statustext}">{$status.statustext}</span></a></li>
                            {/foreach}
                        </ul>

Pretty much the same code would apply for clientareadomains.tpl

I would appreciate if you could give hint on what to do to make it possible to only show Active products by default. 

Regards

Screenshot at Mar 23 00-26-49.png

Link to comment
Share on other sites

16 hours ago, artaweb said:

I would appreciate if you could give hint on what to do to make it possible to only show Active products by default. 

filtering/searching would be one option, though it can be fraught with difficulties by the way WHMCS handles it - a simpler solution might just be re-ordering the results.

so in Six, you can pass a value in the url and that will sort the results by the specified column...

clientarea.php?action=services&orderby=domainstatus

this will sort the results so that all results will still be shown, but because the results are now sorted by status, the Active services are shown first.

you can do the same for domains too (orderby=status)...

if you want to define a sort order within the template, then you could modify the code within clientareaproducts.tpl - the code below is from Lagom, but Six is similar (but a different column value is used)...

                {elseif $orderby == 'domainstatus'}
                    table.order(3, '{$sort}');
                {/if}

becomes...

                {else}
                    table.order(3, '{$sort}');
                {/if}

and then on page load, active services should be shown first - though the user can still filter on status (with Six, but same should apply to Lagom), or resort by other columns.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated