Jump to content

Disable client area if invoices unpaid


Recommended Posts

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.

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

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

Link to comment
Share on other sites

  • 4 months later...

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
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