mdwebhosting Posted December 1, 2008 Share Posted December 1, 2008 Hi Guys, I have a custom field for BPay reference and I need to set the value of this custom field automatically when an account is created. I've tried to find any helps in the forum without any success. Please advise. Thanks. 0 Quote Link to comment Share on other sites More sharing options...
Shaun Posted December 1, 2008 Share Posted December 1, 2008 Hi Guys, I have a custom field for BPay reference and I need to set the value of this custom field automatically when an account is created. I've tried to find any helps in the forum without any success. Please advise. Thanks. You could do this with ActionHooks. When a client is created assign them a reference. 0 Quote Link to comment Share on other sites More sharing options...
mdwebhosting Posted December 2, 2008 Author Share Posted December 2, 2008 Hi Shaun, I've tried to do this in the actionhooks.php without any success. Please advise. Below is the code that I used. function actionhook_ClientSignup($vars) { # This function runs when a new client is added # $vars["ClientID"] # $vars["FirstName"] # $vars["LastName"] # $vars["CompanyName"] # $vars["Email"] # $vars["Address1"] # $vars["Address2"] # $vars["City"] # $vars["State"] # $vars["Postcode"] # $vars["Country"] # $vars["PhoneNumber"] # $vars["Password"] $uid = $vars['ClientID']; $total = 0; $even = 1; while ($uid > 0) { $val = ($uid % 10) * (++$even%2? 1 : 2); if ($val > 10) $val = ((int)($val / 10)) + $val % 10; if ($val == 10) $val = 1; $total += $val; $uid /= 10; } $ret = 10 - ($total % 10); if ($ret >= 10) $ret = 0; $bpayid = $uid . $ret; $sql = new mysqli('localhost', 'mdwh_scripte', 'nfX4wsT6j', 'mdwh_myacc'); $sql->query('INSERT INTO tblcustomfieldsvalues VALUES (3, $uid, $bpayid)'); } 0 Quote Link to comment Share on other sites More sharing options...
ABetterDealForAll Posted March 8, 2010 Share Posted March 8, 2010 (edited) Hi Shaun,I've tried to do this in the actionhooks.php without any success. Please advise. Below is the code that I used. Hi mdwebhosting & Shaun I also spent time trying to get this to work. I seems that the Action Hook is called BEFORE any records are created in the DB thus there is no way of Updating them. MATT is there a Action Hook that can be called on "Client Creation" but after all information is stored/created in the DB or a way of doing this in the current action hook? Edited March 8, 2010 by ABetterDealForAll 0 Quote Link to comment Share on other sites More sharing options...
beachbum Posted July 26, 2012 Share Posted July 26, 2012 Has anyone got a BPAY module working. Please contact me sbdc@smellyblackdog.com.au Ta Samantha 0 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.