thehoster Posted February 4, 2013 Share Posted February 4, 2013 Hi all, This is what i am looking to do in a round about fashion; Let me explain. If customer has active services then display "This html code" else if client has no active services show "You have no active services" If someone is able to help me on this one it would be greatly appreciated. Thanks in advance folks x 0 Quote Link to comment Share on other sites More sharing options...
bear Posted February 4, 2013 Share Posted February 4, 2013 Have you looked here in the docs? http://docs.whmcs.com/Template_Syntax 0 Quote Link to comment Share on other sites More sharing options...
thehoster Posted February 4, 2013 Author Share Posted February 4, 2013 Yes this page only contains info on syntax's only relating to if a user is logged in or not, not that of if a client has an active service or not. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted February 4, 2013 Share Posted February 4, 2013 Yes this page only contains info on syntax's only relating to if a user is logged in or not You sure about that? "Displaying Text if Certain Conditions Are Met" Add {debug} to the template and see what variables are available on the page you want to do this on (remove after checking that), and see if you can spot the variable that will show the condition you're trying to "catch". From there the syntax can be adapted from the link above. 0 Quote Link to comment Share on other sites More sharing options...
thehoster Posted February 4, 2013 Author Share Posted February 4, 2013 (edited) I think i have spotted the variable that i need, So would i need code like this; {if $status.Active} This is the code that would be displayed to the customer if they have an active account status {else} This is the code that would be displayed to the customer if they have an inactive account status {/if} there is also another possible one i spotted; {if $clientareaactive.Active} This is the code that would be displayed to the customer if they have an active account status {else} This is the code that would be displayed to the customer if they have an inactive account status {/if} I have tested the below code and even the below doesn't work {if $clientareaactive eq "Active"} This is the code that would be displayed to the customer if they have an active account status {else} This is the code that would be displayed to the customer if they have an inactive account status {/if} If not could you advice where i am going wrong, as im not the most confident coder on the planet. Edited February 4, 2013 by thehoster 0 Quote Link to comment Share on other sites More sharing options...
bear Posted February 4, 2013 Share Posted February 4, 2013 I think i have spotted the variable that i need, So would i need code like this; {if $status.Active} This is the code that would be displayed to the customer if they have an active account status {else} This is the code that would be displayed to the customer if they have an inactive account status {/if} That applies to if the account is active, not if they have an active product/service. I believe what you're looking for (untested) is this: {if $clientsstats.productsnumactive ge 1} stuff here {else} Other stuff here {/if} Oh, and in your example above, it's not $status. I believe it should be: {$clientsdetails.status eq Active} 0 Quote Link to comment Share on other sites More sharing options...
thehoster Posted February 5, 2013 Author Share Posted February 5, 2013 Thanks so much for your replies, Using your above code i have now managed to get it working thanks so much once again. ;-) 0 Quote Link to comment Share on other sites More sharing options...
bear Posted February 5, 2013 Share Posted February 5, 2013 Excellent; nicely done. 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.