Jump to content

Recommended Posts

Posted (edited)

Hello,

I'm editing the Six template and I cannot find how to customize the service status filter for service table.

To clarify: I have created my custom button filters, for the service status and I would like to add the count badges, as View shows in Product & Services page.

https://nimb.ws/MpaeRK

Any suggestion on how to add the count number of each status in my custom buttons ?

I'm using `includes/pageheader.tpl` and bootstrap to create nav-pill buttons and default six template files with few GUI customization 

Edited by pRieStaKos

Share this post


Link to post
Share on other sites
1 hour ago, pRieStaKos said:

Any suggestion on how to add the count number of each status in my custom buttons ?

the sidebar should add filters for (default) service statuses that it finds for that client - are you using custom service statuses in some way ?

1 hour ago, pRieStaKos said:

I'm using `includes/pageheader.tpl` and bootstrap to create nav-pill buttons and default six template files with few GUI customization 

are you wanting to add new custom filters to the sidebar or just using buttons elsewhere on the page? either way, i'd be inclined to think that you'll have to query the database to get a count for the current user and  the occurrence of your custom status(es) in  their services.

Share this post


Link to post
Share on other sites
14 hours ago, brian! said:

the sidebar should add filters for (default) service statuses that it finds for that client - are you using custom service statuses in some way ?

Not custom service statuses. I'm using the default service statuses.

14 hours ago, brian! said:

the sidebar should add filters for (default) service statuses that it finds for that client - are you using custom service statuses in some way ?

are you wanting to add new custom filters to the sidebar or just using buttons elsewhere on the page? either way, i'd be inclined to think that you'll have to query the database to get a count for the current user and  the occurrence of your custom status(es) in  their services.

Yes. I created custom buttons (bootstrap nav-pills) as filters, at the top right of the table.

Share this post


Link to post
Share on other sites

the quick way to get a status count for a particular status in a hook would be...

<?php

# Get Service Count Hook
# Written by brian!

function services_counts_hook($vars)
{	
	$client = Menu::context('client');
	$activeservices = $client->services->where('domainstatus','Active')->count();
	return array("activecount" => $activeservices);
}
add_hook("ClientAreaPageProductsServices", 1, "services_counts_hook");

that will give you an {$activecount} variable you can use in the template to show the number of active services... it should tally with the value in the sidebar (though I assume you aren't showing the sidebar).

if you need other selected status counts, then it's just a case of duplicating that second line, adjusting the domainstatus value and including the result in the return array.

if you need all the status counts in one array and via one query, then i'd probably use capsule/SQL rather than the model method.

Share this post


Link to post
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.


  • Similar Content

    • By Mas-J
      Condition:
      I've create copy of banktransfer and rename it as localbank.
      My goal: I want to show some dynamic Virtual Account number (combination of fixed bank code + custom field) when payment method localbank is selected and client preview invoice then choose it (viewinvoice.tpl)
      I've try with several variable but there's no suitable value to match the selected payment method using if-else condition.
      Could you tell me what the correct variable for selected payment method ?
      Here's my custom script on viewinvoice.tpl
      {if $paymentmethod == "localbank"}      <td>: 123123{$clientsdetails["customfields2"]}</td> {else}      <td>: 77777{$clientsdetails["customfields2"]}</td> {/if} With that code, when localbank is selected the result always show the else result.
      Although when I change the $paymentmenthod value to banktransfer, it still show the else result.
    • By mywebhostingaccount
      I am trying to modify the cart.php page. This page displays the Web Hosting plan comparisons in my WHMCS website. At the bottom of this page it says "Included With Every Plan" and then lists features. I want to show this section more prominantly, so I want to move the "Included With Every Plan" heading more towards the top of the page. I looked up about the .php file, and then the .tpl file that is associated with it. I downloaded some files to look at them, but couldn't find where to move this heading as I'm not versed in php or html at all.
      Would there be a place I could access (probably .tpl file written in html) where I could simply rearrange the location of the "Included With Every Plan" heading?
      The page in question is: https://mywebhostingaccount.com/cart.php
    • By battles
      I want to achieve the attached product ordering table. You can select the top row/ column, then the corresponding product below. Anyone know if there are any templates for this?
       

    • By Adam Grayson
      So each page generally included the header.tpl file as you'd expect, this is fine, but some pages include it twice, not sure why this is and I can't seem to find where this is.
       
      Here is an example, on the submitticket.php page, it's included twice, I've been into the .tpl files for this but it doesn't appear the header is included there, any ideas?? It's also present on the affiliate page.
       

       
      This is the supportticketsubmit-steptwo.tpl file, as you can see the header isn't there, I'm assuming there's a generic page where it's included but can't find it.

       
      Thanks 🙂 
    • By daniel_peters
      Any one having issues with the client forgotten password button? the page does not load at all on my whmcs installation now? wondered if anyone else was having the same issue, there has been some updates to the login.tpl which could be causing this maybe?
  • 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