Jump to content
jeebee123

Disable client area if invoices unpaid

Recommended Posts

Hi!

So, we're having a problem with a client which has chargeback the automatic payments.

Is there a way to disable access to the client area, untill the payments have been received?

So that the client is able to make a payment, but can't access services.

Share this post


Link to post
Share on other sites

You would need to make a hook that checks if the user has an unpaid invoice and if so, automatically redirect to the invoice on all pages (don't make the hook execute on the invoice itself, though, and probably also disable it on support pages and such).

Share this post


Link to post
Share on other sites
3 hours ago, DennisHermannsen said:

You would need to make a hook that checks if the user has an unpaid invoice and if so, automatically redirect to the invoice on all pages (don't make the hook execute on the invoice itself, though, and probably also disable it on support pages and such).

May run into the issue if the client has multiple unpaid invoices, which one would they be redirected to? Perhaps a redirection to the invoice page would work, but all payment related pages would need to be whitelisted in the hook.

Share this post


Link to post
Share on other sites

There is a module who can hide individual products from the Client Area per Client.

You must then manually unhide the product, when the Client pays.

Is that how you want it?

 

Share this post


Link to post
Share on other sites
On 9/29/2022 at 8:00 PM, web2008 said:

There is a module who can hide individual products from the Client Area per Client.

You must then manually unhide the product, when the Client pays.

Is that how you want it?

 

Hmm, that would be to much work. It would be best to just disable access to the client area, except the invoices.

There are clients with 200 domains, would be a lot of work to hide all of this domains.

Share this post


Link to post
Share on other sites
15 minutes ago, web2008 said:

What about this?

Maybe it still works. Haven't tested!

 

Looks good, I've uploaded it into the hooks directory, doesn't work :(.

If I look into the code, I thought it would work. But for some reason it doesn't.

Share this post


Link to post
Share on other sites

Ah nevermind. It works.

Only this function doesn't work:

add_hook("ClientAreaPage", 1, function($vars){
    

add_hook("ClientAreaPage", 1, function($vars){
    
    /**
     * Overdue Invoices Limit
     *
     * If client has overdue invoices more than this number a restriction will be applied
     * Default is 0, mean if client has 1 or more overdue invoices
     */
    $overdueInvoicesLimit = 0;

 

The invoices limit dont work.

Share this post


Link to post
Share on other sites

Does anyone still have this? I can't get the link to work and I would like this please.

Thank you

Share this post


Link to post
Share on other sites

I wrote this a few years ago. Just tried it on 8.6 and it still works like a charm

If client has an overdue invoice (with grace period added), it doesn't block them from the client area (you don't really want that), it simply redirects them to the invoice page so they can pay it.

Unzip, upload php to includes/hooks/ and you're good to go.

 

 

unpaid_invoices.zip

Edited by twhiting9275

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.


  • 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