sdv Posted March 14, 2018 Share Posted March 14, 2018 Hello, The PreModuleCreate docs states that it is possible to return a "key/value pairs to override the parameters to be used in account creation". However, I am unable to do it. Here is my hook: <?php function add_prefix_to_domain($vars) { if ($vars['params']['pid'] != 45) { // ignore everything except my test product return; } logActivity('Domain is: ' . $vars['params']['domain']); return [ 'domain' => 'hello-' . $vars['params']['domain'] ]; } add_hook('PreModuleCreate', 10, add_prefix_to_domain); add_hook('PreModuleCreate', 20, add_prefix_to_domain); add_hook('PreModuleCreate', 30, add_prefix_to_domain); I am expecting to see in the activity log (given that the domain for a service is "world.com"): Quote Domain is: world.com Domain is: hello-world.com Domain is: hello-hello-world.com What I actually got: Quote Domain is: world.com Domain is: world.com Domain is: world.com Do I misunderstood the docs or there is a bug in docs or WHMCS? Does anyone have a working example of PreModuleCreate hook where the override mechanism actually works? Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts