Jump to content

Order Button on "RE-NEW domains screen" does not work when client has no domains active yet?


Recommended Posts

Hi, all I wonder if one of you can reproduce this error on your WHMCS systems.

As I have had a few customers clicking on RE-NEW domains,

but they have no domains active yet,

the output screen shows the customer that they have no domains,

but with an Order Button, that goes nowhere.

Link to comment
Share on other sites

I can reproduce it !

 

this is effectively 3 bugs - certainly 2, and WHMCS can argue the 3rd between themselves!

 

1. why, if the client has no domains, is the renewal link even in the navbar? it could be removed by a hook, but that's not the point.... this is the one they can argue amongst themselves.

2. if the client has no domains, why show the order button?

 

btw - this can be quickly fixed by wrapping the code in an {if} statement... below is from Standard_cart

 

                {if $clientsstats.numdomains gt 0}
               <p class="text-center">
                   <button type="submit" class="btn btn-success">
                       <i class="fa fa-shopping-cart"></i>
                       {$LANG.ordernowbutton}
                   </button>
               </p>
               {/if}

3. someone in WHMCS needs to invest in a dictionary or a spellcheck! :roll:[

 

There are no domains elligible for renewal in your account

there are only 2 'L's in 'eligible' - even in US American! :)

 

you might want to open a ticket or report it as a bug(s) - I would expect the next release to be imminent, so the sooner you can get it in, the quicker they can fix it.

Link to comment
Share on other sites

Thank you brian!

 

I corrected the spelling with my trusty override and I also reported the unwanted function/s as bug/s.

 

Great Thanks to you not just for this post but all your posts on the forums has helped me a great deal... more than you know ;)

Link to comment
Share on other sites

Brian! and Others I have decided to go with this code here below to replace the button with my custom button if a customer has no domains. I will paste here if others might need it too:

 

In your Standard Order Cart if you are using it replace this code below in the file domainrenewals.tpl

 

Original:

<p class="text-center">

<button type="submit" class="btn btn-success">

<i class="fa fa-shopping-cart"></i>

{$LANG.ordernowbutton}

</button>

</p>

 

Replace above code with this:

 

{if !empty($renewals)}

<p class="text-center">

<button type="submit" class="btn btn-success">

<i class="fa fa-shopping-cart"></i>

{$LANG.ordernowbutton}

</button>

</p>

{else}

<p class="text-center">

<img src="https://PATH TO.JPG-OFF-Pic" style="width:0px;height:0px;"></a>

<a href="https://WHMCS-DOMAIN/cart.php?a=add&domain=register"><img onmouseover="this.src='https://PATH TO.JPG-ON-Pic';" onmouseout="this.src='https://PATH TO.JPG-OFF-Pic';" src="https://PATH TO.JPG-OFF-Pic" alt="" height="73" width="266"></a>

{/if}

 

You will need to replace:

https://PATH TO.JPG-OFF-Pic (With pic for OFF)

https://PATH TO.JPG-ON-Pic (With pic for ON)

https://WHMCS-DOMAIN/cart.php?a=add&domain=register (With Your Domain Path to where the button must go when clicked)

 

That's it , it works great for me maybe it can help you too dear forum member/reader. If you can improve the code at all feel free to do so and post it here please.

 

You might need to adjust the sizes to suit your buttons.

 

If you just want to hide the button from the user with no domains use this code below to replace said code at the top: Or use Brian!'s code he posted works just as well.

 

{if !empty($renewals)}

<p class="text-center">

<button type="submit" class="btn btn-success">

<i class="fa fa-shopping-cart"></i>

{$LANG.ordernowbutton}

</button>

</p>

{/if}

Edited by ITWolfy
Link to comment
Share on other sites

there are many ways to skin a cat! :)

 

a couple of things I spotted with your code... it's not wrong, these are just perhaps some improvements/simplifications. :idea:

 

if you were to upload your images to '/assets/img', you could then use {$BASE_PATH_IMG} in your path instead...

 

<img src="{$BASE_PATH_IMG}/JPG-OFF-Pic" style="width:0px;height:0px;"></a>

and because you know that you're already in the cart, you shouldn't necessarily need the WHMCS domain link in you href...

 

<a  href="cart.php?a=add&domain=register"><img onmouseover="this.src='{$BASE_PATH_IMG}/JPG-ON-Pic';" onmouseout="this.src='{$BASE_PATH_IMG}/JJPG-OFF-Pic';" src="{$BASE_PATH_IMG}/JPG-OFF-Pic" alt="" height="73" width="266"></a>

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