
Newton
Member-
Posts
24 -
Joined
-
Last visited
About Newton

Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Newton's Achievements

Junior Member (1/3)
0
Reputation
-
Newton started following Prevent "renaming" of knowledgebase URLs , Fix a serious flaw in the order template , New API function to get Product addons and 4 others
-
Fix a serious flaw in the order template
Newton replied to Chris74's topic in Service Offers & Requests
why is still still an issue 7 years later... and despite multiple price increases. Incredible. -
@drosendo Thank you! Your code was super helpful. It was working fine but I needed it to also show prices in the different currencies we offer so I modified it a little. Here is my version if someone else needs it. <?php if (!defined("WHMCS")) { die("This file cannot be accessed directly"); } function getproductaddons_getParams($vars) { $param = array('action' => array(), 'params' => array()); if (isset($vars['cmd'])) { $param['action'] = $vars['cmd']; $param['params'] = (object) $vars['apivalues1']; $param['adminuser'] = $vars['adminuser']; } else { $param['action'] = $vars['_POST']['action']; unset($vars['_POST']['username']); unset($vars['_POST']['password']); unset($vars['_POST']['action']); $param['params'] = (object) $vars['_POST']; } return (object) $param; } try { $vars = get_defined_vars(); $postFields = getproductaddons_getParams($vars); $pid = $postFields->params->pid; $addons = array(); $result = select_query("tbladdons", "*", array("showorder" => "on")); while ($data = mysql_fetch_array($result)) { if ($data['packages'] == '' || in_array($pid, explode(',', $data['packages']))) { $addon = array( 'id' => $data['id'], 'name' => $data['name'], 'description' => $data['description'], 'billingcycle' => $data['billingcycle'], 'tax' => $data['tax'], 'showorder' => $data['showorder'], 'downloads' => $data['downloads'], 'autoactivate' => $data['autoactivate'], 'suspendproduct' => $data['suspendproduct'], 'welcomeemail' => $data['welcomeemail'], 'weight' => $data['weight'], 'type' => $data['type'], 'module' => $data['module'], 'pricing' => array(), ); $result2 = select_query("tblpricing", "", array("type" => "addon", "relid" => $data['id'])); while ($pricing = mysql_fetch_array($result2)) { $currencyCode = get_query_val("tblcurrencies", "code", array("id" => $pricing['currency'])); $addon['pricing'][$currencyCode] = array( 'monthly' => $pricing['monthly'], 'quarterly' => $pricing['quarterly'], 'semiannually' => $pricing['semiannually'], 'annually' => $pricing['annually'], 'biennially' => $pricing['biennially'], 'triennially' => $pricing['triennially'], ); } $addons[] = $addon; } } $apiresults = array("result" => "success", "addons" => $addons); } catch (Exception $e) { $apiresults = array("result" => "error", "message" => $e->getMessage()); }
-
Be careful, if you have business client in Europe and do this for VAT, it will supersede the VAT exempt status of those clients (meaning the query will add the taxes on ALL invoices).
-
@Juanzo Did you ever figure out how to rewrite the hook to see active services?
-
Prevent "renaming" of knowledgebase URLs
Newton replied to DennisHermannsen's topic in Share Your Best Practices & Tips
Thanks for this hook. I cannot believe WHMCS hasn't fixed that yet 😕 -
Server Status - Show only server belonging to client
Newton replied to Atomic's topic in Using WHMCS
deleted -
Server Status - Show only server belonging to client
Newton replied to Atomic's topic in Using WHMCS
Oh... you are right, this is lagom, not six/21. I thought it was the same but I guess not! -
Server Status - Show only server belonging to client
Newton replied to Atomic's topic in Using WHMCS
Thank you @brian! indeed that fixed it. The code of serverstatus.tpl changed a bit so here it is if someone needs the latest version : <tbody>{if $myservers|count gt 0} {foreach from=$servers key=num item=server} {if $server.name|in_array:$myservers} <tr> <td>{$server.name}</td> <td class="text-center" id="port80_{$num}"> <div class="loader">{include file="$template/includes/loader.tpl" classes="spinner-sm"}</div> </td> <td class="text-center" id="port21_{$num}"> <div class="loader">{include file="$template/includes/loader.tpl" classes="spinner-sm"}</div> </td> <td class="text-center" id="port110_{$num}"> <div class="loader">{include file="$template/includes/loader.tpl" classes="spinner-sm"}</div> </td> <td class="text-center"> <a href="{$server.phpinfourl}" target="_blank">{$LANG.serverstatusphpinfo}</a> </td> <td class="text-center" id="load{$num}"> <div class="loader">{include file="$template/includes/loader.tpl" classes="spinner-sm"}</div> </td> <td class="text-center" id="uptime{$num}"> <div class="loader">{include file="$template/includes/loader.tpl" classes="spinner-sm"}</div> <script>function checkLsPort(num, port) { WHMCS.http.jqClient.post('serverstatus.php', 'ping=1&num=' + num + '&port=' + port, function(data) { var str = data; var res = str.replace("assets/img", "templates/lagom/assets/img/serverstatus"); res = res.replace("gif", "svg"); jQuery("#port" + port + "_" + num).html(res); }); } jQuery(document).ready(function() { checkLsPort({$num}, 80); checkLsPort({$num}, 21); checkLsPort({$num}, 110); getStats({$num}); });</script> </td> </tr> {/if} {/foreach} {else} <tr> <td colspan="7">{$LANG.serverstatusnoservers}</td> </tr> {/if} </tbody> -
Server Status - Show only server belonging to client
Newton replied to Atomic's topic in Using WHMCS
Hello @brian! and all, With the latest upgrade (well, a few months ago), that little script stopped working. Has anyone succeeded in fixing it or implementing another way to display only the relevant server to the client? Thanks! -
Update... oh no I just found that 🙄
-
Hello, I thought someone would have ran into the same issue before me but I can't find any previous thread regarding that issue. I'm trying to update some TLDs prices for past and current orders (for example, change the price of .me to 9.99 from 7.99 for every order, new and renew). Some of these TLDs are free for those clients who have an hosting plan (using the WHMCS free domain promotion) and therefore appear as "Recurring Amount = 0" in the client account. Now, I was hoping that using WHMCS bulk pricing updater, the price of these free domains would not be updated... but that is not the case. Running the updater upgrades all orders, and these previously free domains now appear as "Recurring Amount = 9.99) Questions: - Do I need to go back and edit these to 0 manually or (and I've read the WHMCS doc but I'm still confused) will WHMCS just not invoice these domains as long as they are still attached to the hosting plan (i.e. regardless of what's written in "recurring amount" box). - If I need to adjust all these free domains manually, I understand a better way to go at it would be to only adjust prices for domains with the "specific price" criteria (using my exemple, I'd only update prices for .me domains with a 7.99 price). Is that right? Given that we have many many domains, I'm a bit worry I might miss updating the domain price of some old clients with an odd price. Sorry for the long thread/question and thanks again for your help! Current Price
-
Making addon A required to order addon B
Newton replied to Newton's topic in Admin & Configuration Questions
That is the way I have it configured right now. But hoping I can split some of the addons (not just the ones given as exemple) to simplify the offer (by removing some redundancy - if that makes any sense :)