Jump to content
zitu4life

How to auto disable domain badges if client do not have any domain registered

Recommended Posts

Posted (edited)

Hello there

I have a situation where most of my clients do not have domain or hosting services (some has, but they are few).

I know that WHMCS has in settings an options to disable domains, but I can not use it because I have clients with domain.

image.png.2348675f94d5fbc4c00de617e3332e3c.png

 

So, my idea is, if would be possible to get hidden domain badges if a client do not have domain, which means:

1 -normally we have this picture.

image.png.c900bf7a5ecda817595bbb5dd57c2908.png

But I am looking  to have it like this, considered that this client do not have DOMAINS

image.png.b2979fd90658d98a6c12e2a1cd2fe965.png

PS: I edit those pictures using windows paint.

Does anyone already think in such situation in the past, already has a hook for this?

Edited by zitu4life

Share this post


Link to post
Share on other sites
13 hours ago, zitu4life said:

Does anyone already think in such situation in the past, already has a hook for this?

the domains tile is already conditional and is shown if a) the client has domains or b) domain registration and/or transfer is enabled generally.

the quick fix would be to edit clientareahome and remove b) so that...

{if $clientsstats.numdomains || $registerdomainenabled || $transferdomainenabled}

becomes...

{if $clientsstats.numdomains}

I suppose if you wanted to do the equivalent as a hook, then it's...

<?php

function homepage_domains_badge_hook($vars) {
	
	if ($vars['templatefile'] == "clientareahome") {
		$client = Menu::context('client');
		$domains = $client->domains()->count;
		if (!$domains) {
			return array("registerdomainenabled" => null, "transferdomainenabled" => null);
		}
	}
}
add_hook("ClientAreaPageHome", 1, "homepage_domains_badge_hook");

if a client has domains, their count will be shown... if they don't, then that badge will show an affiliates count, or if client not an affiliate, a quotes count.

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 inaamOs8quatrEtroiS9##
      hey .
      i have created group of products with their own products , but when i enter my client area , or use the product link , it's says your cart is empty , when i click on the groupe of products it says theri is no product to display .
       
      any help please 
       
       
      thank you 
    • By battles
      I'm glad WHMCS finally came around to introducing this, however is there a way to convert our years and years of contacts/sub accounts into users?
    • By sokalsondha
      Hello everyone
      Can you help me something on this please.
       
      In my invoice list I have changed the button name from Unpaid to Make-Payment. Because what I want is when my customer click on this make payment button it will be take them direct to payment page instead of viewinvoice page..
      Because I have put a button to download the pdf invoice so my customer can download the pdf invoice if they want to see it.
      But I really need to skip the viewinvoice page. 
      So if I have PayPal as a payment method for that invoice then when client click on that Make-Payment button it will be take them to PayPal directly.
       
      Can someone help me with the code in the template file.
       
      Thanks a million in advance
      Please see the current invoice list page
       

    • By Stevie B.
      Attached is the image I would like to have in place of the text. I am stumped as to how to do this. Any help would be greatly appreciated.
      Thanky
      Stevie

    • By battles
      Client reporting that they cannot add a new payment method - credit card.
      I can reproduce. i am also seeing strange issues.
      When I "Login as Client" I can see that I am masquerading as them, however when I go to add payment method, I get a login screen.
      I've never seen this behavior before.
      I am also now getting a Oops 404 I've I try to reset a password as a client would on the front facing portal.
  • 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