ghasemy50 Posted September 7, 2021 Share Posted September 7, 2021 (edited) Hello dear members, I want to write a hook to avoid order deliver after invoice paid, and accept or reject it by hook file. Can you please help me about hook conditions? Thanks. Edited September 7, 2021 by ghasemy50 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted September 8, 2021 Share Posted September 8, 2021 Check OrderPaid hook index. https://developers.whmcs.com/hooks-reference/shopping-cart/#orderpaid Along with AcceptOrder and ModuleCreate 0 Quote Link to comment Share on other sites More sharing options...
string Posted September 8, 2021 Share Posted September 8, 2021 Actually the correct hook for that is PreModuleCreate. The example at the hook documentation is already pretty clear about how to abort the service creation. But note that this hook is not executed for domains. For domains you have to use the following hooks: PreDomainRegister PreDomainTransfer I guess you want to check the order manually and then activate it. Since the hook would always prevent creation even if you try it as admin, you need to add another condition to the code. My suggestion would therefore be that you check in the hook whether the hook was triggered by an admin (e.g. via the PHP session), and if so, you allow the creation of the service. 1 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.