Jump to content

sentq

GearHead
  • Content count

    2,207
  • Joined

  • Last visited

  • Days Won

    32

sentq last won the day on January 14

sentq had the most liked content!

Community Reputation

367 Excellent

1 Follower

About sentq

  • Rank
    WHMCS GearHead
  1. Coupon Codes

    only coupon code saved in client's order, every time new invoice created for that service it will pull discount settings using the coupon code used first time, then do all the validation (apply it once or recurring, discount percentage, etc) then apply the discount if applicable, hence if you delete this coupon or even modify it's options, these options should be applied to future invoice.
  2. How to create online mobile store using WHCMS?

    so you want to sell mobile devices in this website? if you could explain what you after in more details we may be able to offer solutions or guide you to the right direction
  3. Account Manager Addon

    what you ask for is doable, contact me here with further requirements for quote and ETA
  4. Accessing $_COOKIE var when hook executes

    it's not documented as few other classes
  5. Authentication Questions

    probably you need at least about 1k clients complainant for hot fix to be released I guess, 3 weeks ago I discovered 1 issue in v7.4.1, made tests in v6.3.1 and the issue exists since this version it's more than 2 years and no one face it! so I've sent a bug report and hoped they will not tell me that it supposed to do that, because it shouldn't, well they confirmed the issue and hopefully they will release a fix in v7.5.0
  6. Authentication Questions

    does it work in v7.4.2?
  7. Accessing $_COOKIE var when hook executes

    all documented classes located here: https://docs.whmcs.com/classes/7.4/index.html
  8. the following URLs will redirect you to view invoice and display the built-in message of success/failure payment: other options you see in tpl file doesn't work in the same way, but maybe you can try activating them using ActionHook:ClientAreaPageViewInvoice <?php add_hook('ClientAreaPageViewInvoice', 1, function($vars) { // Display Payment Pending Message if the "pendingreview" specified in the view invoice URL if (isset($_GET['pendingreview'])){ return array("pendingReview" => true); } });
  9. the following part check if "custom" action were called, if so you can specify different options for each action (template file, variables, etc): $requestedAction = isset($_REQUEST['customAction']) ? $_REQUEST['customAction'] : ''; if ($requestedAction == 'manage') { $serviceAction = 'get_usage'; $templateFile = 'templates/manage.tpl'; } else { $serviceAction = 'get_stats'; $templateFile = 'templates/overview.tpl'; }
  10. you can always edit the viewinvoice.tpl file, for example add the following: {if $smarty.get.thankyou}<div class="alert alert-danger">Thank you!</div>{/if} and redirect your client to this URL: http://whmcs/viewinvoice.php?id=123&thankyou=1
  11. Sent custom variable to a hook function

    modify the first function to pull the titles within foreach loop like bellow: function hook_get_categories($vars) { //Action $url = 'some webpage'; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLINFO_HEADER_OUT => true, CURLOPT_HEADER => false, )); $content = curl_exec($ch); //$information = curl_getinfo($ch); curl_close($ch); $categories = json_decode($content, true); $categorylist = array(); foreach ($categories as $category){ $category['titles'] = hook_get_titles($category['category_id']); $categorylist[] = $category; } return array("categories" => $categorylist); } then modify your template foreach loop to the following: {foreach from=$categories item=items} List : {$items.category_id} - {$items.category_name}<br> {foreach from=$items.titles key=index item=title}Title #{$index}: {$title}<br>{/foreach} -------<br> {/foreach}
  12. timed images

    the first thing to do is to move your PHP code to ActionHook:ClientAreaPage and pass the final results as variables to be displayed in your template more easily and securely <?php add_hook("ClientAreaPage", 1, function($vars){ $dayoftheyear = date("z"); if ($dayoftheyear >= 61 && $dayoftheyear <= 90) { $m_subbanner ="<a href=\"https://XXXXX.COM/site-lock.php/\"><img src=\"subbanner/sl.jpg\"></a>"; } elseif ($dayoftheyear >= 91 && $dayoftheyear <= 120) { $m_subbanner ="<a href=\"https://XXXXX.COM/video-conf.php\"><img src=\"subbanner/videoconf.jpg\"></a>"; } elseif ($dayoftheyear >= 121 && $dayoftheyear <= 180) { $m_subbanner ="<a href=\"https://XXXXX.COM/seo-marketing.php\"><img src=\"subbanner/seo.jpg\"></a>"; } else { $m_subbanner ="<img src=\"subbanner/default.jpg\">"; } return array("m_subbanner" => $m_subbanner); }); then in your template use {$m_subbanner} to display the image
  13. the header("Location: URL-To-Invoice") is perfect
  14. smarty->assign on ClientAreaPage Hook

    as @brian! code shows, you may use "ClientAreaPageViewInvoice" instead of "ClientAreaPage" (the last one doesn't work as it did in the past), also no need to check for current file name as your your function will only run in view invoice page: function custom_bank_gateway_text($vars) { global $details; global $_LANG; if ($vars['status'] == 'Unpaid' && $vars['paymentmethod'] == 'Bank Transfer') { return array("paymentbutton" => "Hello User!"); } } add_hook('ClientAreaPageViewInvoice', 5, 'custom_bank_gateway_text');
  15. I understand that you need to display a success/failure message of payment when redirecting to view invoice page, correct me if I'm wrong. you could use one of these URLs when redirecting your client to view invoice page: http://test.com/whmcs/viewinvoice.php?id=123&paymentsuccess=true http://test.com/whmcs/viewinvoice.php?id=123&paymentfailed=true
×

Important Information

By using this site, you agree to our Terms of Use & Guidelines