ServerNebula Posted April 21, 2017 Share Posted April 21, 2017 Hi there! I've modified my WHMCS to allow product scaling through a credit system. I like it but, I want to disable upgrade/downgrades for 7 days before allowing it again. This is my plan, I need a little help with the hook though. After a product upgrade (or downgrade) this hook performs. But.. it does not work, what's wrong with it? <?php add_hook('AfterProductUpgrade', 1, function($vars) { $userid = $vars['userid']; $command = "updateclientproduct"; $adminuser = "admin"; $values["clientid"] = $vars["userid"]; $values["description"] = "Updating Last Upgrade Date via ClientAreaUpgrade hook"; $values = array('serviceid' => $params["serviceid"], 'customfields' => base64_encode(serialize(array('Last Upgrade' => echo date('d/m/Y')))); $results = localAPI($command,$values,$adminuser); return array(); } ); I'm hoping to add the system date to their product custom field ("Last Upgrade") when upgrading. Then in the clientarea product details .tpl I can check If the current system date is over 7 days from the saved system date from the custom field. Furthermore showing or not, the upgrade/downgrade buttons. Simple? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
wulfric Posted May 3, 2017 Share Posted May 3, 2017 Woah! Credit system? I wanna check this out!! Are you going to opensource it or sell it? One of my favorite credit systems in the whole wide world is for WordPress and it's called MyCred - is that what you are coding? Heheh I've searched and searched and only 2 available solutions are both promising but still missing something. That picture you linked looks mad fancy. 0 Quote Link to comment Share on other sites More sharing options...
ServerNebula Posted May 24, 2017 Author Share Posted May 24, 2017 Woah! Credit system? I wanna check this out!! Are you going to opensource it or sell it? One of my favorite credit systems in the whole wide world is for WordPress and it's called MyCred - is that what you are coding? Heheh I've searched and searched and only 2 available solutions are both promising but still missing something. That picture you linked looks mad fancy. Oh it is mad fancy!! Have spent over 4 months on it actually haha. It's based on Digital ocean's system. In a rush but thought i'd throw up some pics (logo's are blurred btw.. then I remembered my username LOL). http://imgur.com/a/L19XV 0 Quote Link to comment Share on other sites More sharing options...
ServerNebula Posted May 24, 2017 Author Share Posted May 24, 2017 Woah! Credit system? I wanna check this out!! Are you going to opensource it or sell it? One of my favorite credit systems in the whole wide world is for WordPress and it's called MyCred - is that what you are coding? Heheh I've searched and searched and only 2 available solutions are both promising but still missing something. That picture you linked looks mad fancy. Oh it is mad fancy!! Have spent over 4 months on it actually haha. It's based on Digital ocean's system. In a rush but thought i'd throw up some pics (logo is blurred btw). http://imgur.com/a/L19XV 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.